fixed tests failing in travis - they had been disabled on windows

This commit is contained in:
John Lonergan 2016-08-24 00:31:28 +01:00
parent 9596fea017
commit 2243a011d5
2 changed files with 10 additions and 17 deletions

View File

@ -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));

View File

@ -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