Examples of Bindings


Examples of org.erlide.util.erlang.Bindings

    @Test
    public void testMatch_novar() throws Exception {
        final OtpErlangObject p = OtpErlang.parse("[a, {b}]");
        final OtpErlangObject t1 = OtpErlang.parse("[a, {b}]");
        final Bindings r = OtpErlang.match(p, t1);
        Assert.assertNotNull(r);
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertNotNull(r);
    }

    @Test
    public void testMatch() throws Exception {
        final Bindings r = OtpErlang.match("[W, V]", "[a, b]");
        Assert.assertEquals(r.get("W"), new OtpErlangAtom("a"));
        Assert.assertEquals(r.get("V"), new OtpErlangAtom("b"));
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertEquals(r.get("V"), new OtpErlangAtom("b"));
    }

    @Test
    public void testMatch_0() throws Exception {
        final Bindings b = new BindingsImpl();
        b.put("W", new OtpErlangAtom("a"));
        final Bindings r = OtpErlang.match("[W, V]", "[a, b]", b);
        Assert.assertNotNull(r);
        Assert.assertEquals(r.get("V"), new OtpErlangAtom("b"));
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertEquals(r.get("V"), new OtpErlangAtom("b"));
    }

    @Test
    public void testMatch_1() throws Exception {
        final Bindings r = OtpErlang.match("[W, V]", "[\"a\", {[1, 2]}]");
        Assert.assertEquals(r.get("W"), new OtpErlangString("a"));
        Assert.assertEquals(r.get("V"), OtpErlang.parse("{[1, 2]}"));
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertEquals(r.get("V"), OtpErlang.parse("{[1, 2]}"));
    }

    @Test
    public void testMatch_same() throws Exception {
        final Bindings r = OtpErlang.match("[W, {V}]", "[a, {a}]");
        Assert.assertEquals(r.get("W"), new OtpErlangAtom("a"));
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertEquals(r.get("W"), new OtpErlangAtom("a"));
    }

    @Test
    public void testMatch_any() throws Exception {
        final Bindings r = OtpErlang.match("[_, {_}]", "[a, {b}]");
        Assert.assertNotNull(r);
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertNotNull(r);
    }

    @Test
    public void testMatch_same_fail() throws Exception {
        final Bindings r = OtpErlang.match("[W, {W}]", "[a, {b}]");
        Assert.assertNull(r);
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertNull(r);
    }

    @Test
    public void testMatch_sig_a() throws Exception {
        final Bindings r = OtpErlang.match("W:a", "zzz");
        Assert.assertEquals(r.get("W"), new OtpErlangAtom("zzz"));
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertEquals(r.get("W"), new OtpErlangAtom("zzz"));
    }

    @Test
    public void testMatch_sig_i() throws Exception {
        final Bindings r = OtpErlang.match("W:i", "222");
        Assert.assertEquals(r.get("W"), new OtpErlangLong(222));
    }
View Full Code Here

Examples of org.erlide.util.erlang.Bindings

        Assert.assertEquals(r.get("W"), new OtpErlangLong(222));
    }

    @Test
    public void testMatch_sig_fail() throws Exception {
        final Bindings r = OtpErlang.match("W:i", "zzz");
        Assert.assertNull(r);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.