fix pathing in tests which can not use NBIO

This commit is contained in:
Jonathan Shook
2024-01-11 00:48:30 -06:00
parent 8d9d684e79
commit 990d3b73bb

View File

@@ -27,43 +27,43 @@ class NBAtFileTest {
@Test @Test
public void testParseSimpleListDefaultFmt() { public void testParseSimpleListDefaultFmt() {
LinkedList<String> strings = NBAtFile.includeAt("@atfiles/simple_list.yaml"); LinkedList<String> strings = NBAtFile.includeAt("@src/test/resources/atfiles/simple_list.yaml");
assertThat(strings).containsExactly("arg1","arg2","arg3"); assertThat(strings).containsExactly("arg1","arg2","arg3");
} }
@Test @Test
public void testParseSimpleMapDefaultFmt() { public void testParseSimpleMapDefaultFmt() {
LinkedList<String> strings = NBAtFile.includeAt("@atfiles/simple_map.yaml"); LinkedList<String> strings = NBAtFile.includeAt("@src/test/resources/atfiles/simple_map.yaml");
assertThat(strings).containsExactly("arg1:val1","arg2:val2","arg3:val3"); assertThat(strings).containsExactly("arg1:val1","arg2:val2","arg3:val3");
} }
@Test @Test
public void testThatEmptyPathWithPathSpecifierIsInvalid() { public void testThatEmptyPathWithPathSpecifierIsInvalid() {
assertThrows(RuntimeException.class, () -> NBAtFile.includeAt("@atfiles/simple_map.yaml:>:")); assertThrows(RuntimeException.class, () -> NBAtFile.includeAt("@src/test/resources/atfiles/simple_map.yaml:>:"));
} }
@Test @Test
public void testParseSimpleMapWithFormatter() { public void testParseSimpleMapWithFormatter() {
LinkedList<String> strings = NBAtFile.includeAt("@atfiles/simple_map.yaml>:"); LinkedList<String> strings = NBAtFile.includeAt("@src/test/resources/atfiles/simple_map.yaml>:");
assertThat(strings).containsExactly("arg1:val1","arg2:val2","arg3:val3"); assertThat(strings).containsExactly("arg1:val1","arg2:val2","arg3:val3");
} }
@Test @Test
public void testParseSimpleMapSlashesOrDots() { public void testParseSimpleMapSlashesOrDots() {
LinkedList<String> strings = NBAtFile.includeAt("@atfiles/mixed_structures.yaml:amap/ofamap.ofalist"); LinkedList<String> strings = NBAtFile.includeAt("@src/test/resources/atfiles/mixed_structures.yaml:amap/ofamap.ofalist");
assertThat(strings).containsExactly("option1","option2"); assertThat(strings).containsExactly("option1","option2");
} }
@Test @Test
public void testMapPathWithColonFormat() { public void testMapPathWithColonFormat() {
LinkedList<String> strings = NBAtFile.includeAt("@atfiles/mixed_structures.yaml:amap/ofamap.ofentries>:"); LinkedList<String> strings = NBAtFile.includeAt("@src/test/resources/atfiles/mixed_structures.yaml:amap/ofamap.ofentries>:");
assertThat(strings).containsExactly("key1:value1","key2:value2"); assertThat(strings).containsExactly("key1:value1","key2:value2");
} }
@Test @Test
public void testMapPathWithEqualsFormat() { public void testMapPathWithEqualsFormat() {
LinkedList<String> strings = NBAtFile.includeAt("@atfiles/mixed_structures.yaml:amap/ofamap.ofentries>="); LinkedList<String> strings = NBAtFile.includeAt("@src/test/resources/atfiles/mixed_structures.yaml:amap/ofamap.ofentries>=");
assertThat(strings).containsExactly("key1=value1","key2=value2"); assertThat(strings).containsExactly("key1=value1","key2=value2");
} }