Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangObject$Hash


        Assert.assertEquals(expected, value);
    }

    @Test
    public void testFormatParser_simple_3() throws Exception {
        final OtpErlangObject value = OtpErlang.format("~x");
        final OtpErlangObject expected = OtpErlang.parse("~x");
        Assert.assertEquals(expected, value);
    }
View Full Code Here


        Assert.assertEquals(expected, value);
    }

    @Test
    public void testFormatParser_list() throws Exception {
        final OtpErlangObject value = OtpErlang.format("[~a,2,~a]", "hej", "brr");
        final OtpErlangObject expected = OtpErlang.parse("[hej,2,brr]");
        Assert.assertEquals(expected, value);
    }
View Full Code Here

        Assert.assertEquals(expected, value);
    }

    @Test
    public void testFormatParser_tuple() throws Exception {
        final OtpErlangObject value = OtpErlang.format("{~a,2,~a}", "hej", "brr");
        final OtpErlangObject expected = OtpErlang.parse("{hej,2,brr}");
        Assert.assertEquals(expected, value);
    }
View Full Code Here

        Assert.assertEquals(expected, value);
    }

    @Test
    public void testFormatParser_full() throws Exception {
        final OtpErlangObject value = OtpErlang.format("[~a,{2,~a},5]", "hej", "brr");
        final OtpErlangObject expected = OtpErlang.parse("[hej,{2,brr},5]");
        Assert.assertEquals(expected, value);
    }
View Full Code Here

        Assert.assertEquals(expected, value);
    }

    @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

        Assert.assertNull(r);
    }

    @Test
    public void testMatch_ellipsis_1() throws Exception {
        final OtpErlangObject r = termParser.parse("[x|_]");
        Assert.assertNotNull(r);
    }
View Full Code Here

            final String text = document.get();
            final String scannerName = module.getScannerName();

            final InternalScanner internalScanner = (InternalScanner) ErlangEngine
                    .getInstance().getSimpleScannerService();
            final OtpErlangObject checkAll = internalScanner.checkAll(scannerName, text,
                    true);
            String s;
            if (checkAll instanceof OtpErlangTuple) {
                final OtpErlangTuple t = (OtpErlangTuple) checkAll;
                s = Util.stringValue(t.elementAt(0));
                final OtpErlangObject o1 = t.elementAt(1);
                final OtpErlangObject o2 = t.elementAt(2);
                dumpText(o1.toString(), "/tmp/scannerTokens.txt");
                dumpText(o2.toString(), "/tmp/rescanTokens.txt");
            } else {
                s = Util.stringValue(checkAll);
            }
            ErlLogger.info("%s", s);
            if (module != null) {
View Full Code Here

    @Test
    public void sublist_1() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[a,2,b,4]");
        final OtpErlangList s = (OtpErlangList) termParser.parse("[2,b,4]");
        final OtpErlangObject ss = r.getTail();
        Assert.assertEquals(s, ss);
    }
View Full Code Here

    @Test
    public void sublist_2() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3|4]");
        final OtpErlangList s = (OtpErlangList) termParser.parse("[2,3|4]");
        final OtpErlangObject ss = r.getTail();
        Assert.assertEquals(s, ss);
    }
View Full Code Here

    @Test
    public void sublist_4() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3,4]");
        final OtpErlangList s = (OtpErlangList) termParser.parse("[3,4]");
        final OtpErlangObject ss = r.getNthTail(2);
        Assert.assertEquals(s, ss);
    }
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangObject$Hash

Copyright © 2018 www.massapicom. 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.