From 2243a011d5395b0e53be5fb9fa086b882cf1ec4a Mon Sep 17 00:00:00 2001 From: John Lonergan Date: Wed, 24 Aug 2016 00:31:28 +0100 Subject: [PATCH] fixed tests failing in travis - they had been disabled on windows --- .../config/impl/ConfigDocumentParser.java | 2 +- .../typesafe/config/impl/ConfParserTest.scala | 25 +++++++------------ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/config/src/main/java/com/typesafe/config/impl/ConfigDocumentParser.java b/config/src/main/java/com/typesafe/config/impl/ConfigDocumentParser.java index b00e2e91..0c674beb 100644 --- a/config/src/main/java/com/typesafe/config/impl/ConfigDocumentParser.java +++ b/config/src/main/java/com/typesafe/config/impl/ConfigDocumentParser.java @@ -384,7 +384,7 @@ final class ConfigDocumentParser { // quoted string if (!Tokens.isValueWithType(t, ConfigValueType.STRING)) { - throw parseError("expecting a quoted string inside file(), classpath(), or url(), rather than: " + throw parseError("expecting include parameter to be a quoted string inside file(), classpath(), or url(), rather than: " + t); } children.add(new ConfigNodeSimpleValue(t)); diff --git a/config/src/test/scala/com/typesafe/config/impl/ConfParserTest.scala b/config/src/test/scala/com/typesafe/config/impl/ConfParserTest.scala index b4c4ce68..0b04568b 100644 --- a/config/src/test/scala/com/typesafe/config/impl/ConfParserTest.scala +++ b/config/src/test/scala/com/typesafe/config/impl/ConfParserTest.scala @@ -645,7 +645,7 @@ class ConfParserTest extends TestUtils { // properties-like syntax val conf8 = parseConfig(""" # ignored comment - + # x.y comment x.y = 10 # x.z comment @@ -710,29 +710,22 @@ class ConfParserTest extends TestUtils { @Test def includeFileNotQuoted() { - // this test cannot work on Windows val f = resourceFile("test01") - if (isWindows) { - System.err.println("includeFileNotQuoted test skipped on Windows") - } else { - val e = intercept[ConfigException.Parse] { - ConfigFactory.parseString("include file(" + f + ")") - } - assertTrue("wrong exception: " + e.getMessage, e.getMessage.contains("expecting include parameter")) + val e = intercept[ConfigException.Parse] { + ConfigFactory.parseString("include file(" + f + ")") } + assertTrue("wrong exception: " + e.getMessage, + e.getMessage.contains("expecting include parameter to be a quoted string")) } @Test def includeFileNotQuotedAndSpecialChar() { val f = resourceFile("test01") - if (isWindows) { - System.err.println("includeFileNotQuoted test skipped on Windows") - } else { - val e = intercept[ConfigException.Parse] { - ConfigFactory.parseString("include file(:" + f + ")") - } - assertTrue("wrong exception: " + e.getMessage, e.getMessage.contains("expecting a quoted string")) + val e = intercept[ConfigException.Parse] { + ConfigFactory.parseString("include file(:" + f + ")") } + assertTrue("wrong exception: " + e.getMessage, + e.getMessage.contains("expecting include parameter to be a quoted string")) } @Test