Skip to content

Commit

Permalink
Fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez committed Jan 25, 2025
1 parent 77bb8f5 commit 0e38087
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/nimblepkg/packageparser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ proc readPackageInfo(pkgInfo: var PackageInfo, nf: NimbleFile, options: Options,
## This version uses a cache stored in ``options``, so calling it multiple
## times on the same ``nf`` shouldn't require re-evaluation of the Nimble
## file.
assert fileExists(nf)
if not fileExists(nf):
writeStackTrace()
assert fileExists(nf), "File does not exist: " & nf

# Check the cache.
if useCache and options.pkgInfoCache.hasKey(nf):
Expand Down
8 changes: 4 additions & 4 deletions tests/tsat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ suite "SAT solver":
collectAllVersions(pkgVersionTable, root, options, downloadMinimalPackage)
var output = ""
let solvedPkgs = pkgVersionTable.getSolvedPackages(output)
let pkgB = solvedPkgs.filterIt(it.pkgName == "b")[0]
let pkgC = solvedPkgs.filterIt(it.pkgName == "c")[0]
check pkgB.pkgName == "b" and pkgB.version == newVersion "0.1.4"
check pkgC.pkgName == "c" and pkgC.version == newVersion "0.1.0"
let pkgB = solvedPkgs.filterIt(it.pkgMin.name == "b")[0]
let pkgC = solvedPkgs.filterIt(it.pkgMin.name == "c")[0]
check pkgB.pkgMin.name == "b" and pkgB.pkgMin.version == newVersion "0.1.4"
check pkgC.pkgMin.name == "c" and pkgC.pkgMin.version == newVersion "0.1.0"
check "random" in pkgVersionTable

removeDir(options.pkgCachePath)
Expand Down

0 comments on commit 0e38087

Please sign in to comment.