Add more testcases for yaml merge-node reconciling

This commit is contained in:
Kris De Volder
2019-02-05 15:06:25 -08:00
parent 5026fdc412
commit c8abce640a

View File

@@ -4944,6 +4944,39 @@ public class ConcourseEditorTest {
);
}
@Test
public void reconcileMalformedMergeNode() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: foo\n" +
" type: git\n" +
" source:\n" +
" <<: scalar\n"
);
editor.assertProblems(
"foo|Unused",
"source|'uri' is required",
"scalar|Expected a mapping or list of mappings"
);
}
@Test
public void reconcileMalformedMergeNodeList() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: foo\n" +
" type: git\n" +
" source:\n" +
" <<:\n" +
" - scalar\n"
);
editor.assertProblems(
"foo|Unused",
"source|'uri' is required",
"scalar|Expected a mapping for merging"
);
}
@Test
public void anchorsAndReferenceSample_1() throws Exception {
Editor editor = harness.newEditor(