-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resdir: cache contents on creation, serve case-insensitive, fixes #104
- Loading branch information
Showing
3 changed files
with
52 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
OLLEH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import std/[os, strutils] | ||
import neverwinter/[resman, resdir] | ||
|
||
let rr = newResolvedResRef("SAMPLE.txt") | ||
var rm = newResMan(0) | ||
|
||
const sourceDir = currentSourcePath().splitFile().dir | ||
|
||
rm.add newResDir(sourceDir / "corpus") | ||
rm.add newResDir(sourceDir / "corpus_uc") | ||
|
||
let rd = rm.demand(rr, useCache=false) | ||
|
||
# The uppercase file must override the lowercase variant further up the stack | ||
# (the uppercase variant contains OLLEH, the lowercase variant HELLO) | ||
# This test will only be effective on case-sensitive file sytems. | ||
let check = rd.readAll().strip() | ||
doAssert check == "OLLEH", "got: " & check |