Fix error message for unsuccessful namespace disambiguation
Also fix small typo in tests README.
commitf851e54c53149b354a4c518f715f8208f9dbf92a
authorBartosz Przygoda <bprzygoda@gmail.com>
dateSat 6 Aug 2016, 00:26 (10 years ago)
parentf645488
src/Idris/Error.hs+1−1
@@ -146,7 +146,7 @@ warnDisamb ist (PDisamb ds tm) = warnDisamb ist tm >>
146146 when (not (any (isIn d . fst) (ctxtAlist (tt_ctxt ist)))) $
147147 ierror . Msg $
148148 "Nothing found in namespace \"" ++
149− intercalate "." (map T.unpack d) ++
149+ intercalate "." (map T.unpack . reverse $ d) ++
150150 "\"."
151151 isIn d (NS _ ns) = isPrefixOf d ns
152152 isIn d _ = False
test/README.md+1−1
@@ -121,7 +121,7 @@ and somewhat self-explanatory.
121121 # Using cabal
122122 cabal test --test-options="--pattern foo042 --accept"
123123 # Using stack
124− stack test --test-arguments"--pattern foo042 --accept"
124+ stack test --test-arguments="--pattern foo042 --accept"
125125 ```
1261268. Check the content of `expected`. Maybe the test didn't do what you thought it would. Fix and go back to 7 until it's ok.
1271279. Add under `Extra-source-files` in `idris.cabal` the patterns that match the folder's content. If you forget this, your test will fail in Travis CI. With the previous example, it should be at least:
test/TestData.hs+2−1
@@ -111,7 +111,8 @@ testFamiliesData = [
111111 ( 5, ANY ),
112112 ( 6, ANY ),
113113 ( 7, ANY ),
114− ( 8, ANY )]),
114+ ( 8, ANY ),
115+ ( 9, ANY )]),
115116 ("ffi", "FFI",
116117 [ ( 1, ANY ),
117118 ( 2, ANY ),
test/error009/expectednew file+1
@@ -0,0 +1 @@
1+Uncaught error: Nothing found in namespace "Foo.Bar".
test/error009/runnew file+2
@@ -0,0 +1,2 @@
1+#!/usr/bin/env bash
2+${IDRIS:-idris} $@ -e "with Foo.Bar 42"