on master help sign in
Normalise embedded paths in `normalise`.
commit32fb4e0e7bf4109cb3f629a32f1644003841b0fc authorSteven Shaw <steven@steshaw.org> dateFri 5 Aug 2016, 11:16 (10 years ago) parent5f3f81d
3 files changed+4−15
test/TestRun.hs+3−1 test/quasiquote001/filter-embedded-filenames−13 test/quasiquote001/run+1−1
test/TestRun.hs+3−1
@@ -95,8 +95,10 @@ runTest path flags = do
9595 (_, output, _) <- readCreateProcessWithExitCode run ""
9696 writeFile (path </> "output") (normalise output)
9797 where
98− -- Normalise paths e.g. ".\foo.idr" to "./foo.idr".
98+ -- Normalise paths e.g. '.\foo.idr' to './foo.idr'.
99+ -- Also embedded paths e.g. ".\\Prelude\\List.idr" to "./Prelude/List.idr".
99100 normalise ('.' : '\\' : c : xs) | isLetter c = '.' : '/' : c : normalise xs
101+ normalise ('\\':'\\':xs) = '/' : normalise xs
100102 normalise (x : xs) = x : normalise xs
101103 normalise [] = []
102104
test/quasiquote001/filter-embedded-filenamesdeleted−13
@@ -1,13 +0,0 @@
1−#!/usr/bin/env perl
2−
3−#
4−# Change filenames embedded in double quotes from Windows-style separators to
5−# unix-style.
6−#
7−# e.g. ".\\Prelude\\List.idr" to "./Prelude/List.idr".
8−#
9−
10−while (<>) {
11− s-(")([^"]+)(")-my ($l, $x, $r) = ($1, $2, $3); $x =~ s#\\\\#/#g; "$l$x$r"-ge;
12− print;
13−}
test/quasiquote001/run+1−1
@@ -1,4 +1,4 @@
11#!/usr/bin/env bash
22${IDRIS:-idris} $@ QuasiquoteBasics.idr -o quasiquote001
3−./quasiquote001 | ./filter-embedded-filenames
3+./quasiquote001
44rm -f quasiquote001 *.ibc