From dce3fb74e55f745444edc1099abfe5aea75dc2be Mon Sep 17 00:00:00 2001 From: Kris De Volder Date: Wed, 21 Dec 2016 08:50:34 -0800 Subject: [PATCH] Duplicate key validation should also work for manifest.yml So... add a test to confirm that. --- .../manifest/yaml/ManifestYamlEditorTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vscode-extensions/vscode-manifest-yaml/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java b/vscode-extensions/vscode-manifest-yaml/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java index 928a04895..10f3c5b7d 100644 --- a/vscode-extensions/vscode-manifest-yaml/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java +++ b/vscode-extensions/vscode-manifest-yaml/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java @@ -483,6 +483,24 @@ public class ManifestYamlEditorTest { editor.assertNoHover("otherdomain.org"); } + @Test + public void reconcileDuplicateKeys() throws Exception { + Editor editor = harness.newEditor( + "#comment\n" + + "applications:\n" + + "- buildpack: zbuildpack\n" + + " name: foo\n" + + " domains:\n" + + " - pivotal.io\n" + + " domains:\n" + + " - otherdomain.org\n" + ); + editor.assertProblems( + "domains|Duplicate key", + "domains|Duplicate key" + ); + } + ////////////////////////////////////////////////////////////////////////////// private void assertCompletions(String textBefore, String... textAfter) throws Exception {