package jetbrains.mps.baseLanguage.tuples.test; /*Generated by MPS */ import junit.framework.TestCase; import junit.framework.Assert; import jetbrains.mps.baseLanguage.tuples.runtime.Tuples; public class GenericNamedTuples_Test extends TestCase { public void test_pair() throws Exception { Pair<String, Integer> pair = new Pair<String, Integer>("abcd", 1); Assert.assertEquals("abcd", pair.first()); Assert.assertSame(1, pair.second()); pair = new Pair<String, Integer>("dbca", 2); Assert.assertEquals("dbca", pair.first()); Assert.assertSame(2, pair.second()); } public void test_pairToIndexedTuple() throws Exception { Pair<Integer, String> pair = new Pair<Integer, String>(1, "abc"); int x; String y; { Tuples._2<Integer, String> _tmp_quuzte_d0b0 = pair; x = _tmp_quuzte_d0b0._0(); y = _tmp_quuzte_d0b0._1(); } Assert.assertSame(1, x); Assert.assertEquals("abc", y); } public GenericNamedTuples_Test() { } public Pair<String, String> pairOfStrings() { return new Pair<String, String>("X", "Y"); } }