on master help sign in
Normalise embedded paths in `normalise`.
32fb4e0Steven Shaw
test/TestRun.hs+3−1
@@ -95,8 +95,10 @@ runTest path flags = do
95 (_, output, _) <- readCreateProcessWithExitCode run ""
95 (_, output, _) <- readCreateProcessWithExitCode run ""
96 writeFile (path </> "output") (normalise output)
96 writeFile (path </> "output") (normalise output)
97 where
97 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".
99 normalise ('.' : '\\' : c : xs) | isLetter c = '.' : '/' : c : normalise xs
100 normalise ('.' : '\\' : c : xs) | isLetter c = '.' : '/' : c : normalise xs
101+ normalise ('\\':'\\':xs) = '/' : normalise xs
100 normalise (x : xs) = x : normalise xs
102 normalise (x : xs) = x : normalise xs
101 normalise [] = []
103 normalise [] = []
102
104
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 @@
1#!/usr/bin/env bash
1#!/usr/bin/env bash
2${IDRIS:-idris} $@ QuasiquoteBasics.idr -o quasiquote001
2${IDRIS:-idris} $@ QuasiquoteBasics.idr -o quasiquote001
3−./quasiquote001 | ./filter-embedded-filenames
3+./quasiquote001
4rm -f quasiquote001 *.ibc
4rm -f quasiquote001 *.ibc