on master help sign in
Merge pull request #3339 from BartAdv/reversed-nothing-found-in-ns

Fix error message for unsuccessful namespace disambiguation

commitdcf6ec93e05a4a1e781b0a6c09692b339b4a8953 authorNiklas Larsson <metaniklas@gmail.com> dateThu 11 Aug 2016, 21:23 (10 years ago) parentf6454883285d36
5 files changed+7−4
src/Idris/Error.hs+1−1 test/README.md+1−2 test/TestData.hs+2−1 test/error009/expected+1 test/error009/run+2
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−2
@@ -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:
@@ -148,7 +148,6 @@ Currently, `NONE` has the same effect as `ANY`, but this will change.
148148
1491491. Delete the corresponding directory
1501502. Remove the corresponding line in the definition of `testFamiliesData` in `TestData.hs`
151−3. Remove the related lines under `Extra-source-files` in `idris.cabal`
152151
153152### Updating golden files
154153
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"