Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
omnibs committed May 22, 2024
1 parent 436e7b4 commit 05f10d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion nri-redis/src/Redis/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ paramValues script' =
printScript :: Script a -> Text
printScript Script {luaScript, quasiQuotedString, params} =
let printableParams = Log.unSecret params
in "Script { luaScript = \"" ++ luaScript ++ "\", quasiQuotedString = \"" ++ quasiQuotedString ++ "\", params = " ++ Debug.toString printableParams ++ " }"
in "Script { luaScript = \"" ++ luaScript ++ "\", quasiQuotedString = \"" ++ quasiQuotedString ++ "\", params = " ++ Debug.toString printableParams ++ " }"
24 changes: 12 additions & 12 deletions nri-redis/test/Spec/Redis/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ parserTests =
|> mapLeft P.errorBundlePretty
|> Expect.equal
( Left
"1:3:\n\
\ |\n\
\1 | ${}\n\
\ | ^\n\
\unexpected '}'\n\
\expecting anything but '$', '{' or '}' (no records, sorry) or white space\n\
\"
"1:3:\n\
\ |\n\
\1 | ${}\n\
\ | ^\n\
\unexpected '}'\n\
\expecting anything but '$', '{' or '}' (no records, sorry) or white space\n\
\"
),
Test.test "ERROR: nested ${}" <| \_ -> do
P.runParser parser "" "asdasd ${ ${ value } }"
Expand Down Expand Up @@ -117,11 +117,11 @@ thTests =
[script|${Key "hi"}|]
|> printScript
|> Expect.equal "Script { luaScript = \"@arg0\", quasiQuotedString = \"${Key \"hi\"}\", params = [ EvaluatedParam\n { kind = RedisKey , name = \"arg0\" , value = \"\\\"hi\\\"\" }\n] }"
-- We can't test for compile-time errors, but manually test our helpful error message, uncomment
-- the lines below:
-- Test.test "compilation error" <| \_ ->
-- [script|${123}|]
-- |> Expect.equal "Doesn't matter, this won't compile"
-- We can't test for compile-time errors, but manually test our helpful error message, uncomment
-- the lines below:
-- Test.test "compilation error" <| \_ ->
-- [script|${123}|]
-- |> Expect.equal "Doesn't matter, this won't compile"
]

mapLeft :: (a -> c) -> Either a b -> Either c b
Expand Down

0 comments on commit 05f10d4

Please sign in to comment.