@Test public void testProcessWithSameFolderInclude() throws Exception { String source = loadSource("testSameFolderIncludes.vert"); String expected = loadSource("testSameFolderIncludes_expected.vert"); String result = classUnderTest.process(source); assertEqualsIgnoreLineEndings(expected, result); }
@Test public void testProcessWithMissingIncludesFailQuiet() throws Exception { String source = loadSource("testMissingIncludes.vert"); String expected = loadSource("testMissingIncludes_expected.vert"); String result = classUnderTest.process(source, true); assertEqualsIgnoreLineEndings(expected, result); }
@Test public void testProcessWithNamedStringOverride() throws Exception { classUnderTest.namedString("include1.glsl", "// Included via override"); String source = loadSource("testNamedStringOverrides.vert"); String expected = loadSource("testNamedStringOverrides_expected.vert"); String result = classUnderTest.process(source); assertEqualsIgnoreLineEndings(expected, result); }
@Test public void testProcessWithNestedIncludes() throws Exception { classUnderTest.namedString("include2.glsl", "#include include3.glsl"); classUnderTest.namedString("bob", "// bob"); String source = loadSource("testNestedIncludes.vert"); String expected = loadSource("testNestedIncludes_expected.vert"); String result = classUnderTest.process(source); assertEqualsIgnoreLineEndings(expected, result); }
@Test public void testProcessWithNamedStringInclude() throws Exception { classUnderTest.namedString("include1", "uniform float included_1;"); classUnderTest.namedString( "include2", "float includedFunction(float arg)\n{\n\treturn arg;\n}"); String source = loadSource("testNamedStringIncludes.vert"); String expected = loadSource("testNamedStringIncludes_expected.vert"); String result = classUnderTest.process(source); assertEqualsIgnoreLineEndings(expected, result); }
@Test public void testProcessWithEmpty() throws Exception { assertEquals("", classUnderTest.process("")); }
@Test public void testProcessWithNull() throws Exception { assertNull(classUnderTest.process(null)); }