mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-23 23:05:35 +03:00
Make every test failure title red and bold
This commit is contained in:
parent
932c788b9f
commit
be43b18a2f
@ -46,20 +46,15 @@ type alias SourceCode =
|
||||
|
||||
didNotExpectErrors : String -> List ReviewError -> String
|
||||
didNotExpectErrors moduleName errors =
|
||||
"""DID NOT EXPECT ERRORS
|
||||
failureMessage "DID NOT EXPECT ERRORS"
|
||||
("""I expected no errors for module `""" ++ moduleName ++ """` but found:
|
||||
|
||||
I expected no errors for module `""" ++ moduleName ++ """` but found:
|
||||
|
||||
""" ++ listErrorMessagesAndPositions errors
|
||||
""" ++ listErrorMessagesAndPositions errors)
|
||||
|
||||
|
||||
parsingFailure : Bool -> { index : Int, source : String } -> String
|
||||
parsingFailure isOnlyFile { index, source } =
|
||||
let
|
||||
title : String
|
||||
title =
|
||||
"TEST SOURCE CODE PARSING ERROR"
|
||||
|
||||
hint : String
|
||||
hint =
|
||||
"""Hint: Maybe you forgot to add the module definition at the top, like:
|
||||
@ -83,14 +78,13 @@ The source code in question is the one at index """
|
||||
++ (String.join "" <| List.take 1 <| String.split "\n" <| String.trim source)
|
||||
++ "`"
|
||||
in
|
||||
title ++ "\n\n" ++ details ++ "\n\n" ++ hint
|
||||
failureMessage "TEST SOURCE CODE PARSING ERROR" (details ++ "\n\n" ++ hint)
|
||||
|
||||
|
||||
globalErrorInTest : ReviewError -> String
|
||||
globalErrorInTest error =
|
||||
"""GLOBAL ERROR IN SOURCE CODE
|
||||
|
||||
I found a global error in the project you provided for this test:
|
||||
failureMessage "GLOBAL ERROR IN SOURCE CODE"
|
||||
("""I found a global error in the project you provided for this test:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
|
||||
@ -98,27 +92,25 @@ I found a global error in the project you provided for this test:
|
||||
|
||||
`elm-review` would fail with this error if the project to be reviewed had
|
||||
the same issue. Please fix this issue in your test.
|
||||
"""
|
||||
""")
|
||||
|
||||
|
||||
messageMismatch : ExpectedErrorData -> ReviewError -> String
|
||||
messageMismatch expectedError error =
|
||||
"""UNEXPECTED ERROR MESSAGE
|
||||
|
||||
I was looking for the error with the following message:
|
||||
failureMessage "UNEXPECTED ERROR MESSAGE"
|
||||
("""I was looking for the error with the following message:
|
||||
|
||||
""" ++ wrapInQuotes expectedError.message ++ """
|
||||
|
||||
but I found the following error message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error)
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error))
|
||||
|
||||
|
||||
underMismatch : ReviewError -> { under : String, codeAtLocation : String } -> String
|
||||
underMismatch error { under, codeAtLocation } =
|
||||
"""UNEXPECTED ERROR LOCATION
|
||||
|
||||
I found an error with the following message:
|
||||
failureMessage "UNEXPECTED ERROR LOCATION"
|
||||
("""I found an error with the following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
|
||||
@ -131,14 +123,13 @@ when I was expecting it under:
|
||||
""" ++ formatSourceCode under ++ """
|
||||
|
||||
Hint: Maybe you're passing the `Range` of a wrong node when
|
||||
calling `Rule.error`."""
|
||||
calling `Rule.error`.""")
|
||||
|
||||
|
||||
unexpectedDetails : List String -> ReviewError -> String
|
||||
unexpectedDetails expectedDetails error =
|
||||
"""UNEXPECTED ERROR DETAILS
|
||||
|
||||
I found an error with the following message:
|
||||
failureMessage "UNEXPECTED ERROR DETAILS"
|
||||
("""I found an error with the following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
|
||||
@ -148,14 +139,13 @@ which I was expecting, but its details were:
|
||||
|
||||
when I was expecting them to be:
|
||||
|
||||
""" ++ formatDetails expectedDetails
|
||||
""" ++ formatDetails expectedDetails)
|
||||
|
||||
|
||||
emptyDetails : ReviewError -> String
|
||||
emptyDetails error =
|
||||
"""EMPTY ERROR DETAILS
|
||||
|
||||
I found an error with the following message:
|
||||
failureMessage "EMPTY ERROR DETAILS"
|
||||
("""I found an error with the following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
|
||||
@ -164,7 +154,7 @@ help the user who encounters the problem.
|
||||
|
||||
The details could:
|
||||
- explain what the problem is
|
||||
- give suggestions on how to solve the problem or alternatives"""
|
||||
- give suggestions on how to solve the problem or alternatives""")
|
||||
|
||||
|
||||
formatDetails : List String -> String
|
||||
@ -182,9 +172,8 @@ formatDetails details =
|
||||
|
||||
wrongLocation : ReviewError -> Range -> String -> String
|
||||
wrongLocation error range under =
|
||||
"""UNEXPECTED ERROR LOCATION
|
||||
|
||||
I was looking for the error with the following message:
|
||||
failureMessage "UNEXPECTED ERROR LOCATION"
|
||||
("""I was looking for the error with the following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
|
||||
@ -200,7 +189,7 @@ I was expecting the error at:
|
||||
|
||||
but I found it at:
|
||||
|
||||
""" ++ rangeAsString (Rule.errorRange error)
|
||||
""" ++ rangeAsString (Rule.errorRange error))
|
||||
|
||||
|
||||
expectedMoreErrors : String -> Int -> List ExpectedErrorData -> String
|
||||
@ -210,9 +199,8 @@ expectedMoreErrors moduleName expectedNumberOfErrors missingExpectedErrors =
|
||||
numberOfErrors =
|
||||
List.length missingExpectedErrors
|
||||
in
|
||||
("""RULE REPORTED LESS ERRORS THAN EXPECTED
|
||||
|
||||
I expected to see """ ++ String.fromInt expectedNumberOfErrors ++ """ errors for module `""" ++ moduleName ++ """` but only found """ ++ String.fromInt (expectedNumberOfErrors - numberOfErrors) ++ """.
|
||||
failureMessage "RULE REPORTED LESS ERRORS THAN EXPECTED"
|
||||
("""I expected to see """ ++ String.fromInt expectedNumberOfErrors ++ """ errors for module `""" ++ moduleName ++ """` but only found """ ++ String.fromInt (expectedNumberOfErrors - numberOfErrors) ++ """.
|
||||
Here are the """ ++ String.fromInt numberOfErrors ++ """ I could not find:
|
||||
|
||||
""")
|
||||
@ -229,18 +217,17 @@ tooManyErrors moduleName extraErrors =
|
||||
numberOfErrors =
|
||||
List.length extraErrors
|
||||
in
|
||||
"""RULE REPORTED MORE ERRORS THAN EXPECTED
|
||||
|
||||
I found """
|
||||
++ (String.fromInt numberOfErrors ++ " " ++ pluralizeErrors numberOfErrors ++ " too many for module `" ++ moduleName ++ "`:\n\n")
|
||||
++ listErrorMessagesAndPositions extraErrors
|
||||
failureMessage "RULE REPORTED MORE ERRORS THAN EXPECTED"
|
||||
("I found "
|
||||
++ (String.fromInt numberOfErrors ++ " " ++ pluralizeErrors numberOfErrors ++ " too many for module `" ++ moduleName ++ "`:\n\n")
|
||||
++ listErrorMessagesAndPositions extraErrors
|
||||
)
|
||||
|
||||
|
||||
locationNotFound : ReviewError -> String
|
||||
locationNotFound error =
|
||||
"""COULD NOT FIND LOCATION FOR ERROR
|
||||
|
||||
I was looking for the error with the following message:
|
||||
failureMessage "COULD NOT FIND LOCATION FOR ERROR"
|
||||
("""I was looking for the error with the following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
|
||||
@ -249,14 +236,13 @@ and I found it, but the code it points to does not lead to anything:
|
||||
""" ++ rangeAsString (Rule.errorRange error) ++ """
|
||||
|
||||
Please try to have the error under the smallest region that makes sense.
|
||||
This will be the most helpful for the person who reads the error message."""
|
||||
This will be the most helpful for the person who reads the error message.""")
|
||||
|
||||
|
||||
underMayNotBeEmpty : { message : String, codeAtLocation : String } -> String
|
||||
underMayNotBeEmpty { message, codeAtLocation } =
|
||||
"""COULD NOT FIND LOCATION FOR ERROR
|
||||
|
||||
I was looking for the error with the following message:
|
||||
failureMessage "COULD NOT FIND LOCATION FOR ERROR"
|
||||
("""I was looking for the error with the following message:
|
||||
|
||||
""" ++ wrapInQuotes message ++ """
|
||||
|
||||
@ -266,14 +252,13 @@ error.
|
||||
|
||||
If this helps, this is where I found the error:
|
||||
|
||||
""" ++ formatSourceCode codeAtLocation
|
||||
""" ++ formatSourceCode codeAtLocation)
|
||||
|
||||
|
||||
locationIsAmbiguousInSourceCode : SourceCode -> ReviewError -> String -> List Int -> String
|
||||
locationIsAmbiguousInSourceCode sourceCode error under occurrencesInSourceCode =
|
||||
"""AMBIGUOUS ERROR LOCATION
|
||||
|
||||
Your test passes, but where the message appears is ambiguous.
|
||||
failureMessage "AMBIGUOUS ERROR LOCATION"
|
||||
("""Your test passes, but where the message appears is ambiguous.
|
||||
|
||||
You are looking for the following error message:
|
||||
|
||||
@ -287,14 +272,13 @@ I found """ ++ String.fromInt (List.length occurrencesInSourceCode) ++ """ locat
|
||||
`Review.Test.atExactly` to make the part you were targetting unambiguous.
|
||||
|
||||
Tip: I found them at:
|
||||
""" ++ listOccurrencesAsLocations sourceCode under occurrencesInSourceCode
|
||||
""" ++ listOccurrencesAsLocations sourceCode under occurrencesInSourceCode)
|
||||
|
||||
|
||||
needToUsedExpectErrorsForModules : String
|
||||
needToUsedExpectErrorsForModules =
|
||||
"""AMBIGUOUS MODULE FOR ERROR
|
||||
|
||||
You gave me several modules, and you expect some errors. I need to know for
|
||||
failureMessage "AMBIGUOUS MODULE FOR ERROR"
|
||||
"""You gave me several modules, and you expect some errors. I need to know for
|
||||
which module you expect these errors to be reported.
|
||||
|
||||
You should use `expectErrorsForModules` to do this:
|
||||
@ -316,9 +300,8 @@ module B exposing (..)
|
||||
|
||||
missingSources : String
|
||||
missingSources =
|
||||
"""MISSING SOURCES
|
||||
|
||||
You used `runOnModules` or `runOnModulesWithProjectData` with an empty list
|
||||
failureMessage "MISSING SOURCES"
|
||||
"""You used `runOnModules` or `runOnModulesWithProjectData` with an empty list
|
||||
of sources files.
|
||||
|
||||
I need sources to reviewing, because reviewing an empty project does not
|
||||
@ -327,49 +310,45 @@ make much sense to me."""
|
||||
|
||||
duplicateModuleName : List String -> String
|
||||
duplicateModuleName moduleName =
|
||||
"""DUPLICATE MODULE NAMES
|
||||
|
||||
I found several modules named `""" ++ String.join "." moduleName ++ """` in the test source codes.
|
||||
failureMessage "DUPLICATE MODULE NAMES"
|
||||
("""I found several modules named `""" ++ String.join "." moduleName ++ """` in the test source codes.
|
||||
|
||||
I expect all modules to be able to exist together in the same project,
|
||||
but having several modules with the same name is not allowed by the Elm
|
||||
compiler.
|
||||
|
||||
Please rename the modules so that they all have different names."""
|
||||
Please rename the modules so that they all have different names.""")
|
||||
|
||||
|
||||
unknownModulesInExpectedErrors : String -> String
|
||||
unknownModulesInExpectedErrors moduleName =
|
||||
"""UNKNOWN MODULES IN EXPECTED ERRORS
|
||||
|
||||
I expected errors for a module named `""" ++ moduleName ++ """` in the list passed to
|
||||
failureMessage "UNKNOWN MODULES IN EXPECTED ERRORS"
|
||||
("""I expected errors for a module named `""" ++ moduleName ++ """` in the list passed to
|
||||
`expectErrorsForModules`, but I couldn't find a module in the test source
|
||||
codes named that way.
|
||||
|
||||
I assume that there was a mistake during the writing of the test. Please
|
||||
match the names of the modules in the test source codes to the ones in the
|
||||
expected errors list."""
|
||||
expected errors list.""")
|
||||
|
||||
|
||||
missingFixes : ExpectedErrorData -> String
|
||||
missingFixes expectedError =
|
||||
"""MISSING FIXES
|
||||
|
||||
I expected that the error with the following message
|
||||
failureMessage "MISSING FIXES"
|
||||
("""I expected that the error with the following message
|
||||
|
||||
""" ++ wrapInQuotes expectedError.message ++ """
|
||||
|
||||
would provide some fixes, but I didn't find any.
|
||||
|
||||
Hint: Maybe you forgot to call a function like `Rule.errorWithFix` or maybe
|
||||
the list of provided fixes was empty."""
|
||||
the list of provided fixes was empty.""")
|
||||
|
||||
|
||||
unexpectedFixes : ReviewError -> String
|
||||
unexpectedFixes error =
|
||||
"""UNEXPECTED FIXES
|
||||
|
||||
I expected that the error with the following message
|
||||
failureMessage "UNEXPECTED FIXES"
|
||||
("""I expected that the error with the following message
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
|
||||
@ -386,14 +365,13 @@ To fix this, you can call `Review.Test.whenFixed` on your error:
|
||||
, details = "<details>"
|
||||
, under = "<under>"
|
||||
}
|
||||
|> Review.Test.whenFixed "<source code>\""""
|
||||
|> Review.Test.whenFixed "<source code>\"""")
|
||||
|
||||
|
||||
fixedCodeMismatch : SourceCode -> SourceCode -> ReviewError -> String
|
||||
fixedCodeMismatch resultingSourceCode expectedSourceCode error =
|
||||
"""FIXED CODE MISMATCH
|
||||
|
||||
I found a different fixed source code than expected for the error with the
|
||||
failureMessage "FIXED CODE MISMATCH"
|
||||
("""I found a different fixed source code than expected for the error with the
|
||||
following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
@ -404,7 +382,7 @@ I found the following result after the fixes have been applied:
|
||||
|
||||
but I was expecting:
|
||||
|
||||
""" ++ formatSourceCode expectedSourceCode
|
||||
""" ++ formatSourceCode expectedSourceCode)
|
||||
|
||||
|
||||
fixedCodeWhitespaceMismatch : SourceCode -> SourceCode -> ReviewError -> String
|
||||
@ -413,9 +391,8 @@ fixedCodeWhitespaceMismatch resultingSourceCode expectedSourceCode error =
|
||||
( resulting, expected ) =
|
||||
highlightDifferencesInSourceCodes resultingSourceCode expectedSourceCode
|
||||
in
|
||||
(Ansi.bold >> Ansi.red) "FIXED CODE MISMATCH (WHITESPACE ISSUE)" ++ """
|
||||
|
||||
I found a different fixed source code than expected for the error with the
|
||||
failureMessage "FIXED CODE MISMATCH (WHITESPACE ISSUE)"
|
||||
("""I found a different fixed source code than expected for the error with the
|
||||
following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
@ -427,7 +404,7 @@ I found the following result after the fixes have been applied:
|
||||
|
||||
but I was expecting:
|
||||
|
||||
""" ++ expected
|
||||
""" ++ expected)
|
||||
|
||||
|
||||
highlightDifferencesInSourceCodes : SourceCode -> SourceCode -> ( String, String )
|
||||
@ -470,9 +447,8 @@ replaceWhitespace lines =
|
||||
|
||||
unchangedSourceAfterFix : ReviewError -> String
|
||||
unchangedSourceAfterFix error =
|
||||
"""UNCHANGED SOURCE AFTER FIX
|
||||
|
||||
I got something unexpected when applying the fixes provided by the error
|
||||
failureMessage "UNCHANGED SOURCE AFTER FIX"
|
||||
("""I got something unexpected when applying the fixes provided by the error
|
||||
with the following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
@ -484,14 +460,13 @@ This is problematic because I will tell the user that this rule provides an
|
||||
automatic fix, but I will have to disappoint them when I later find out it
|
||||
doesn't do anything.
|
||||
|
||||
Hint: Maybe you inserted an empty string into the source code."""
|
||||
Hint: Maybe you inserted an empty string into the source code.""")
|
||||
|
||||
|
||||
invalidSourceAfterFix : ReviewError -> SourceCode -> String
|
||||
invalidSourceAfterFix error resultingSourceCode =
|
||||
"""INVALID SOURCE AFTER FIX
|
||||
|
||||
I got something unexpected when applying the fixes provided by the error
|
||||
failureMessage "INVALID SOURCE AFTER FIX"
|
||||
("""I got something unexpected when applying the fixes provided by the error
|
||||
with the following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
@ -505,14 +480,13 @@ This is problematic because fixes are meant to help the user, and applying
|
||||
this fix will give them more work to do. After the fix has been applied,
|
||||
the problem should be solved and the user should not have to think about it
|
||||
anymore. If a fix can not be applied fully, it should not be applied at
|
||||
all."""
|
||||
all.""")
|
||||
|
||||
|
||||
hasCollisionsInFixRanges : ReviewError -> String
|
||||
hasCollisionsInFixRanges error =
|
||||
"""FOUND COLLISIONS IN FIX RANGES
|
||||
|
||||
I got something unexpected when applying the fixes provided by the error
|
||||
failureMessage "FOUND COLLISIONS IN FIX RANGES"
|
||||
("""I got something unexpected when applying the fixes provided by the error
|
||||
with the following message:
|
||||
|
||||
""" ++ wrapInQuotes (Rule.errorMessage error) ++ """
|
||||
@ -526,13 +500,18 @@ For this reason, I require that the ranges (for replacing and removing) and
|
||||
the positions (for inserting) of every fix to be mutually exclusive.
|
||||
|
||||
Hint: Maybe you duplicated a fix, or you targeted the wrong node for one
|
||||
of your fixes."""
|
||||
of your fixes.""")
|
||||
|
||||
|
||||
|
||||
-- STYLIZING AND FORMATTING
|
||||
|
||||
|
||||
failureMessage : String -> String -> String
|
||||
failureMessage title content =
|
||||
(Ansi.bold >> Ansi.red) title ++ "\n\n" ++ content
|
||||
|
||||
|
||||
formatSourceCode : String -> String
|
||||
formatSourceCode string =
|
||||
formatSourceCodeWithFormatter identity (String.lines string)
|
||||
|
@ -60,7 +60,7 @@ parsingFailureTest =
|
||||
\() ->
|
||||
FailureMessage.parsingFailure True { index = 0, source = "module MyModule exposing (.." }
|
||||
|> expectMessageEqual """
|
||||
TEST SOURCE CODE PARSING ERROR
|
||||
\u{001B}[31m\u{001B}[1mTEST SOURCE CODE PARSING ERROR\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I could not parse the test source code, because it was not valid Elm code.
|
||||
|
||||
@ -71,7 +71,7 @@ Hint: Maybe you forgot to add the module definition at the top, like:
|
||||
\() ->
|
||||
FailureMessage.parsingFailure False { index = 32, source = "module MyModule exposing (.." }
|
||||
|> expectMessageEqual """
|
||||
TEST SOURCE CODE PARSING ERROR
|
||||
\u{001B}[31m\u{001B}[1mTEST SOURCE CODE PARSING ERROR\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I could not parse one of the test source codes, because it was not valid
|
||||
Elm code.
|
||||
@ -107,7 +107,7 @@ didNotExpectErrorsTest =
|
||||
in
|
||||
FailureMessage.didNotExpectErrors "ModuleName" errors
|
||||
|> expectMessageEqual """
|
||||
DID NOT EXPECT ERRORS
|
||||
\u{001B}[31m\u{001B}[1mDID NOT EXPECT ERRORS\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I expected no errors for module `ModuleName` but found:
|
||||
|
||||
@ -140,7 +140,7 @@ messageMismatchTest =
|
||||
in
|
||||
FailureMessage.messageMismatch expectedError error
|
||||
|> expectMessageEqual """
|
||||
UNEXPECTED ERROR MESSAGE
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED ERROR MESSAGE\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I was looking for the error with the following message:
|
||||
|
||||
@ -171,7 +171,7 @@ underMismatchTest =
|
||||
, codeAtLocation = "abcd = 1"
|
||||
}
|
||||
|> expectMessageEqual """
|
||||
UNEXPECTED ERROR LOCATION
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED ERROR LOCATION\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found an error with the following message:
|
||||
|
||||
@ -204,7 +204,7 @@ calling `Rule.error`."""
|
||||
, codeAtLocation = "abcd =\n 1"
|
||||
}
|
||||
|> expectMessageEqual """
|
||||
UNEXPECTED ERROR LOCATION
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED ERROR LOCATION\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found an error with the following message:
|
||||
|
||||
@ -252,7 +252,7 @@ unexpectedDetailsTest =
|
||||
expectedDetails
|
||||
error
|
||||
|> expectMessageEqual """
|
||||
UNEXPECTED ERROR DETAILS
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED ERROR DETAILS\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found an error with the following message:
|
||||
|
||||
@ -290,7 +290,7 @@ when I was expecting them to be:
|
||||
expectedDetails
|
||||
error
|
||||
|> expectMessageEqual """
|
||||
UNEXPECTED ERROR DETAILS
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED ERROR DETAILS\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found an error with the following message:
|
||||
|
||||
@ -334,7 +334,7 @@ emptyDetailsTest =
|
||||
FailureMessage.emptyDetails
|
||||
error
|
||||
|> expectMessageEqual """
|
||||
EMPTY ERROR DETAILS
|
||||
\u{001B}[31m\u{001B}[1mEMPTY ERROR DETAILS\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found an error with the following message:
|
||||
|
||||
@ -368,7 +368,7 @@ wrongLocationTest =
|
||||
{ start = { row = 2, column = 1 }, end = { row = 2, column = 5 } }
|
||||
"abcd"
|
||||
|> expectMessageEqual """
|
||||
UNEXPECTED ERROR LOCATION
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED ERROR LOCATION\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I was looking for the error with the following message:
|
||||
|
||||
@ -404,7 +404,7 @@ but I found it at:
|
||||
{ start = { row = 2, column = 1 }, end = { row = 3, column = 3 } }
|
||||
"abcd =\n 1"
|
||||
|> expectMessageEqual """
|
||||
UNEXPECTED ERROR LOCATION
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED ERROR LOCATION\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I was looking for the error with the following message:
|
||||
|
||||
@ -445,7 +445,7 @@ locationNotFoundTest =
|
||||
in
|
||||
FailureMessage.locationNotFound error
|
||||
|> expectMessageEqual """
|
||||
COULD NOT FIND LOCATION FOR ERROR
|
||||
\u{001B}[31m\u{001B}[1mCOULD NOT FIND LOCATION FOR ERROR\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I was looking for the error with the following message:
|
||||
|
||||
@ -469,7 +469,7 @@ underMayNotBeEmptyTest =
|
||||
, codeAtLocation = "abcd = 1"
|
||||
}
|
||||
|> expectMessageEqual """
|
||||
COULD NOT FIND LOCATION FOR ERROR
|
||||
\u{001B}[31m\u{001B}[1mCOULD NOT FIND LOCATION FOR ERROR\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I was looking for the error with the following message:
|
||||
|
||||
@ -504,7 +504,7 @@ expectedMoreErrorsTest =
|
||||
in
|
||||
FailureMessage.expectedMoreErrors "MyModule" 5 missingErrors
|
||||
|> expectMessageEqual """
|
||||
RULE REPORTED LESS ERRORS THAN EXPECTED
|
||||
\u{001B}[31m\u{001B}[1mRULE REPORTED LESS ERRORS THAN EXPECTED\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I expected to see 5 errors for module `MyModule` but only found 3.
|
||||
Here are the 2 I could not find:
|
||||
@ -531,7 +531,7 @@ tooManyErrorsTest =
|
||||
in
|
||||
FailureMessage.tooManyErrors "MyModule" extraErrors
|
||||
|> expectMessageEqual """
|
||||
RULE REPORTED MORE ERRORS THAN EXPECTED
|
||||
\u{001B}[31m\u{001B}[1mRULE REPORTED MORE ERRORS THAN EXPECTED\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found 1 error too many for module `MyModule`:
|
||||
|
||||
@ -557,7 +557,7 @@ I found 1 error too many for module `MyModule`:
|
||||
in
|
||||
FailureMessage.tooManyErrors "MyOtherModule" extraErrors
|
||||
|> expectMessageEqual """
|
||||
RULE REPORTED MORE ERRORS THAN EXPECTED
|
||||
\u{001B}[31m\u{001B}[1mRULE REPORTED MORE ERRORS THAN EXPECTED\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found 2 errors too many for module `MyOtherModule`:
|
||||
|
||||
@ -597,7 +597,7 @@ locationIsAmbiguousInSourceCodeTest =
|
||||
under
|
||||
(String.indexes under sourceCode)
|
||||
|> expectMessageEqual """
|
||||
AMBIGUOUS ERROR LOCATION
|
||||
\u{001B}[31m\u{001B}[1mAMBIGUOUS ERROR LOCATION\u{001B}[22m\u{001B}[39m
|
||||
|
||||
Your test passes, but where the message appears is ambiguous.
|
||||
|
||||
@ -641,7 +641,7 @@ Tip: I found them at:
|
||||
under
|
||||
(String.indexes under sourceCode)
|
||||
|> expectMessageEqual """
|
||||
AMBIGUOUS ERROR LOCATION
|
||||
\u{001B}[31m\u{001B}[1mAMBIGUOUS ERROR LOCATION\u{001B}[22m\u{001B}[39m
|
||||
|
||||
Your test passes, but where the message appears is ambiguous.
|
||||
|
||||
@ -673,7 +673,7 @@ needToUsedExpectErrorsForModulesTest =
|
||||
\() ->
|
||||
FailureMessage.needToUsedExpectErrorsForModules
|
||||
|> expectMessageEqual """
|
||||
AMBIGUOUS MODULE FOR ERROR
|
||||
\u{001B}[31m\u{001B}[1mAMBIGUOUS MODULE FOR ERROR\u{001B}[22m\u{001B}[39m
|
||||
|
||||
You gave me several modules, and you expect some errors. I need to know for
|
||||
which module you expect these errors to be reported.
|
||||
@ -701,7 +701,7 @@ missingSourcesTest =
|
||||
\() ->
|
||||
FailureMessage.missingSources
|
||||
|> expectMessageEqual """
|
||||
MISSING SOURCES
|
||||
\u{001B}[31m\u{001B}[1mMISSING SOURCES\u{001B}[22m\u{001B}[39m
|
||||
|
||||
You used `runOnModules` or `runOnModulesWithProjectData` with an empty list
|
||||
of sources files.
|
||||
@ -717,7 +717,7 @@ duplicateModuleNameTest =
|
||||
\() ->
|
||||
FailureMessage.duplicateModuleName [ "My", "Module" ]
|
||||
|> expectMessageEqual """
|
||||
DUPLICATE MODULE NAMES
|
||||
\u{001B}[31m\u{001B}[1mDUPLICATE MODULE NAMES\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found several modules named `My.Module` in the test source codes.
|
||||
|
||||
@ -735,7 +735,7 @@ unknownModulesInExpectedErrorsTest =
|
||||
\() ->
|
||||
FailureMessage.unknownModulesInExpectedErrors "My.Module"
|
||||
|> expectMessageEqual """
|
||||
UNKNOWN MODULES IN EXPECTED ERRORS
|
||||
\u{001B}[31m\u{001B}[1mUNKNOWN MODULES IN EXPECTED ERRORS\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I expected errors for a module named `My.Module` in the list passed to
|
||||
`expectErrorsForModules`, but I couldn't find a module in the test source
|
||||
@ -761,7 +761,7 @@ missingFixesTest =
|
||||
in
|
||||
FailureMessage.missingFixes expectedError
|
||||
|> expectMessageEqual """
|
||||
MISSING FIXES
|
||||
\u{001B}[31m\u{001B}[1mMISSING FIXES\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I expected that the error with the following message
|
||||
|
||||
@ -793,7 +793,7 @@ unexpectedFixesTest =
|
||||
in
|
||||
FailureMessage.unexpectedFixes error
|
||||
|> expectMessageEqual """
|
||||
UNEXPECTED FIXES
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED FIXES\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I expected that the error with the following message
|
||||
|
||||
@ -846,7 +846,7 @@ abcd =
|
||||
expectedSourceCode
|
||||
error
|
||||
|> expectMessageEqual """
|
||||
FIXED CODE MISMATCH
|
||||
\u{001B}[31m\u{001B}[1mFIXED CODE MISMATCH\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I found a different fixed source code than expected for the error with the
|
||||
following message:
|
||||
@ -885,7 +885,7 @@ unchangedSourceAfterFixTest =
|
||||
in
|
||||
FailureMessage.unchangedSourceAfterFix error
|
||||
|> expectMessageEqual """
|
||||
UNCHANGED SOURCE AFTER FIX
|
||||
\u{001B}[31m\u{001B}[1mUNCHANGED SOURCE AFTER FIX\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I got something unexpected when applying the fixes provided by the error
|
||||
with the following message:
|
||||
@ -925,7 +925,7 @@ abcd =
|
||||
error
|
||||
sourceCode
|
||||
|> expectMessageEqual """
|
||||
INVALID SOURCE AFTER FIX
|
||||
\u{001B}[31m\u{001B}[1mINVALID SOURCE AFTER FIX\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I got something unexpected when applying the fixes provided by the error
|
||||
with the following message:
|
||||
@ -963,7 +963,7 @@ hasCollisionsInFixRangesTest =
|
||||
in
|
||||
FailureMessage.hasCollisionsInFixRanges error
|
||||
|> expectMessageEqual """
|
||||
FOUND COLLISIONS IN FIX RANGES
|
||||
\u{001B}[31m\u{001B}[1mFOUND COLLISIONS IN FIX RANGES\u{001B}[22m\u{001B}[39m
|
||||
|
||||
I got something unexpected when applying the fixes provided by the error
|
||||
with the following message:
|
||||
|
Loading…
Reference in New Issue
Block a user