Search in sources :

Example 1 with ByteArrayLiteralNode

use of st.gravel.support.compiler.ast.ByteArrayLiteralNode in project gravel by gravel-st.

the class ParserTest method testParseByteArrayHighValues.

@Test
public void testParseByteArrayHighValues() {
    final ByteArrayLiteralNode _node;
    _node = ((ByteArrayLiteralNode) Parser.factory.source_("#[0 127 128 129 255 0]").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), ByteArrayLiteralNode.factory));
    assertEquals((String) "#[0 127 128 129 255 0]", (String) _node.prettySourceString());
    assertTrue(st.gravel.support.jvm.ByteArrayExtensions.equals_(_node.value(), new byte[] { 0, 127, -128, -127, -1, 0 }));
}
Also used : ByteArrayLiteralNode(st.gravel.support.compiler.ast.ByteArrayLiteralNode) Test(org.junit.Test)

Example 2 with ByteArrayLiteralNode

use of st.gravel.support.compiler.ast.ByteArrayLiteralNode in project gravel by gravel-st.

the class ParserTest method testParseByteArray.

@Test
public void testParseByteArray() {
    final ByteArrayLiteralNode _node;
    _node = ((ByteArrayLiteralNode) Parser.factory.source_("#[1 2 3]").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), ByteArrayLiteralNode.factory));
    assertEquals((String) "#[1 2 3]", (String) _node.prettySourceString());
    assertTrue(st.gravel.support.jvm.ByteArrayExtensions.equals_(_node.value(), new byte[] { 1, 2, 3 }));
}
Also used : ByteArrayLiteralNode(st.gravel.support.compiler.ast.ByteArrayLiteralNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ByteArrayLiteralNode (st.gravel.support.compiler.ast.ByteArrayLiteralNode)2