diff --git a/.travis.yml b/.travis.yml index 13b8678..8cfa912 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ language: c env: - BRANCH=0.19.6 - BRANCH=0.20.2 - - BRANCH=#44aadd50cfa647a759610a15967960632bf597ce + # This is the latest working Nim version against which Nimble is being tested + - BRANCH=#212ae2f1257628bd5d1760593ce0a1bad768831a cache: directories: diff --git a/src/nimblepkg/config.nim b/src/nimblepkg/config.nim index ca8dcf2..c4a48fc 100644 --- a/src/nimblepkg/config.nim +++ b/src/nimblepkg/config.nim @@ -1,6 +1,6 @@ # Copyright (C) Dominik Picheta. All rights reserved. # BSD License. Look at license.txt for more info. -import parsecfg, streams, strutils, os, tables, Uri +import parsecfg, streams, strutils, os, tables, uri import version, cli diff --git a/tests/tester.nim b/tests/tester.nim index 2c39a83..bc9722e 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -72,6 +72,12 @@ proc inLines(lines: seq[string], line: string): bool = for i in lines: if line.normalize in i.normalize: return true +proc hasLineStartingWith(lines: seq[string], prefix: string): bool = + for line in lines: + if line.strip(trailing = false).startsWith(prefix): + return true + return false + test "caching of nims and ini detects changes": cd "caching": var (output, exitCode) = execNimble("dump") @@ -117,7 +123,7 @@ test "can validate package structure (#144)": let (output, exitCode) = execNimble(["install", "-y"]) check exitCode == QuitSuccess let lines = output.strip.processOutput() - check(not inLines(lines, "warning")) + check(not lines.hasLineStartingWith("Warning:")) # Test that warnings are produced for the incorrectly structured packages. for package in ["x", "y", "z"]: @@ -128,19 +134,22 @@ test "can validate package structure (#144)": checkpoint(output) case package of "x": - check inLines(lines, "Package 'x' has an incorrect structure. It should" & - " contain a single directory hierarchy for source files," & - " named 'x', but file 'foobar.nim' is in a directory named" & - " 'incorrect' instead.") + check lines.hasLineStartingWith( + "Warning: Package 'x' has an incorrect structure. It should" & + " contain a single directory hierarchy for source files," & + " named 'x', but file 'foobar.nim' is in a directory named" & + " 'incorrect' instead.") of "y": - check inLines(lines, "Package 'y' has an incorrect structure. It should" & - " contain a single directory hierarchy for source files," & - " named 'ypkg', but file 'foobar.nim' is in a directory named" & - " 'yWrong' instead.") + check lines.hasLineStartingWith( + "Warning: Package 'y' has an incorrect structure. It should" & + " contain a single directory hierarchy for source files," & + " named 'ypkg', but file 'foobar.nim' is in a directory named" & + " 'yWrong' instead.") of "z": - check inLines(lines, "Package 'z' has an incorrect structure. The top level" & - " of the package source directory should contain at most one module," & - " named 'z.nim', but a file named 'incorrect.nim' was found.") + check lines.hasLineStartingWith( + "Warning: Package 'z' has an incorrect structure. The top level" & + " of the package source directory should contain at most one module," & + " named 'z.nim', but a file named 'incorrect.nim' was found.") else: assert false