use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class PatternMatchTest method testMatch_sig_a.
@Test
public void testMatch_sig_a() throws Exception {
final OtpBindings r = OtpErlang.match("W:a", "zzz");
Assert.assertEquals(r.get("W"), new OtpErlangAtom("zzz"));
}
use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class PatternMatchTest method testMatch_any.
@Test
public void testMatch_any() throws Exception {
final OtpBindings r = OtpErlang.match("[_, {_}]", "[a, {b}]");
Assert.assertNotNull(r);
}
use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class PatternMatchTest method testMatch_same.
@Test
public void testMatch_same() throws Exception {
final OtpBindings r = OtpErlang.match("[W, {V}]", "[a, {a}]");
Assert.assertEquals(r.get("W"), new OtpErlangAtom("a"));
}
use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class PatternMatchTest method testMatch_ellipsis_2.
@Test
public void testMatch_ellipsis_2() throws Exception {
final OtpBindings r = OtpErlang.match("[X | T]", "[x,y,z]");
Assert.assertNotNull(r);
Assert.assertEquals(new OtpErlangAtom("x"), r.get("X"));
Assert.assertEquals(termParser.parse("[y,z]"), r.get("T"));
}
use of org.erlide.util.erlang.OtpBindings in project erlide_eclipse by erlang.
the class PatternMatchTest method testMatch_sig_fail.
@Test
public void testMatch_sig_fail() throws Exception {
final OtpBindings r = OtpErlang.match("W:i", "zzz");
Assert.assertNull(r);
}
Aggregations