@@ -10,7 +10,6 @@ import qualified Data.Map as Map
10
10
import qualified Data.Set as Set
11
11
import qualified Data.String as String
12
12
import qualified Data.Text as Text
13
- import qualified Data.Text.IO as Text
14
13
import Data.Time
15
14
import GHC.Exts
16
15
import Nix.Lint
@@ -130,21 +129,21 @@ assertParseFail opts file = do
130
129
assertLangOk :: Options -> Path -> Assertion
131
130
assertLangOk opts file = do
132
131
actual <- printNix <$> hnixEvalFile opts (file <> " .nix" )
133
- expected <- Text. readFile $ coerce $ file <> " .exp"
134
- assertEqual " " expected $ toText (actual <> " \n " )
132
+ expected <- readFile $ file <> " .exp"
133
+ assertEqual " " expected $ fromString (actual <> " \n " )
135
134
136
135
assertLangOkXml :: Options -> Path -> Assertion
137
136
assertLangOkXml opts file = do
138
137
actual <- stringIgnoreContext . toXML <$> hnixEvalFile opts (file <> " .nix" )
139
- expected <- Text. readFile $ coerce $ file <> " .exp.xml"
138
+ expected <- readFile $ file <> " .exp.xml"
140
139
assertEqual " " expected actual
141
140
142
141
assertEval :: Options -> [Path ] -> Assertion
143
142
assertEval _opts files =
144
143
do
145
144
time <- liftIO getCurrentTime
146
145
let opts = defaultOptions time
147
- case delete " .nix" $ sort $ toText . takeExtensions . coerce <$> files of
146
+ case delete " .nix" $ sort $ fromString @ Text . takeExtensions . coerce <$> files of
148
147
[] -> void $ hnixEvalFile opts (name <> " .nix" )
149
148
[" .exp" ] -> assertLangOk opts name
150
149
[" .exp.xml" ] -> assertLangOkXml opts name
@@ -153,7 +152,7 @@ assertEval _opts files =
153
152
[" .exp" , " .flags" ] ->
154
153
do
155
154
liftIO $ setEnv " NIX_PATH" " lang/dir4:lang/dir5"
156
- flags <- Text. readFile $ coerce $ name <> " .flags"
155
+ flags <- readFile $ name <> " .flags"
157
156
let flags' | Text. last flags == ' \n ' = Text. init flags
158
157
| otherwise = flags
159
158
case runParserGetResult time flags' of
0 commit comments