Skip to content

Commit 056b90f

Browse files
committed
tests update
1 parent 710d1fb commit 056b90f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/org/scm4j/commons/RegexConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ String prependOmapIfNeed(String content, Yaml yaml) throws IOException {
5353
return content;
5454
}
5555

56-
boolean isSequence(String content, Yaml yaml) {
56+
private boolean isSequence(String content, Yaml yaml) {
5757
StringReader sr = new StringReader(content);
5858
Node node = yaml.compose(sr);
5959
return node != null && node.getNodeId().equals(NodeId.sequence);

src/test/java/org/scm4j/commons/RegexConfigTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,10 @@ public void testPrependOmap() throws Exception {
9292
content = config.prependOmapIfNeed(FileUtils.readFileToString(empty, StandardCharsets.UTF_8), yaml);
9393
assertTrue(StringUtils.countMatches(content, RegexConfig.OMAP_TAG) == 0);
9494
}
95+
96+
@Test
97+
public void testNoOmapTagOnEmptyFile() throws Exception {
98+
File empty = new File(this.getClass().getResource("empty.yml").toURI());
99+
assertTrue(config.noOMAPTag(FileUtils.readFileToString(empty, StandardCharsets.UTF_8)));
100+
}
95101
}

0 commit comments

Comments
 (0)