Package greed.code.lang

Examples of greed.code.lang.CppLanguage


* Greed is good! Cheers!
*/
public class CStyleLanguageTest {
    @Test
    public void parseStringArrayTest() {
        CppLanguage trait = CppLanguage.instance;
        StringBuilder sb = new StringBuilder();
        sb.append("{    \n");
        sb.append("\"Abcde\"\n, \"12345\", \n\n\n");
        sb.append("\"Hello\"\n");
        sb.append(", \"world\"    }");
        String[] parsedValueList = trait.parseValue(sb.toString(), new Param("arg", Type.STRING_ARRAY_TYPE, 0)).getValueList();
        for (String pv : parsedValueList)
            System.out.println(pv);
        Assert.assertArrayEquals("Parsed value is " + Arrays.toString(parsedValueList), parsedValueList,
                new String[]{"\"Abcde\"", "\"12345\"", "\"Hello\"", "\"world\""});
    }
View Full Code Here


                new String[]{"\"Abcde\"", "\"12345\"", "\"Hello\"", "\"world\""});
    }

    @Test
    public void parseOtherArrayTest() {
        CppLanguage trait = CppLanguage.instance;
        StringBuilder sb = new StringBuilder();
        sb.append("{123,    ");
        sb.append("\n123\n,125,999,\n\n12\n,123\n    } \n");
        String[] parsedValueList = trait.parseValue(sb.toString(), new Param("arg", Type.LONG_ARRAY_TYPE, 0)).getValueList();
        for (String pv : parsedValueList)
            System.out.println(pv);
        Assert.assertArrayEquals("Parsed value is " + Arrays.toString(parsedValueList), parsedValueList,
                new String[]{"123LL", "123LL", "125LL", "999LL", "12LL", "123LL"});
    }
View Full Code Here

TOP

Related Classes of greed.code.lang.CppLanguage

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.