You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This splits two unit tests that were testing multiple cases in one go
into multiple unit tests - one per each case.
Note, that original tests were expecting an accurate error for each
of multiple lines of malformed string literals. They would no longer
pass with changes introduced by previous commits in this PR.
Copy file name to clipboardExpand all lines: tests/fsharp/Compiler/Language/StringInterpolation.fs
+40-60
Original file line number
Diff line number
Diff line change
@@ -730,70 +730,50 @@ let x3 : FormattableString = $"one %10s{String.Empty}" // no %10s in Formattable
730
730
(FSharpDiagnosticSeverity.Error,3376,(6,30,6,55),
731
731
"Invalid interpolated string. Interpolated strings used as type IFormattable or type FormattableString may not use '%' specifiers, only .NET-style interpolands such as '{expr}', '{expr,3}' or '{expr:N5}' may be used.")|]
732
732
733
-
734
-
[<Test>]
735
-
let``String interpolation negative nested in single`` ()=
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
753
-
(FSharpDiagnosticSeverity.Error,3373,(5,24,5,26),
754
-
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
755
-
(FSharpDiagnosticSeverity.Error,3373,(6,24,6,26),
756
-
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
757
-
(FSharpDiagnosticSeverity.Error,3373,(7,25,7,26),
758
-
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
759
-
(FSharpDiagnosticSeverity.Error,3373,(8,25,8,26),
760
-
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
761
-
(FSharpDiagnosticSeverity.Error,3373,(9,25,9,27),
762
-
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.")|]
769
-
770
-
[<Test>]
771
-
let``String interpolation negative nested in triple`` ()=
772
-
letcode="
773
-
774
-
open System
775
-
let TripleInTripleInterpolated = $\"\"\"123{456}789{\"\"\"012\"\"\"}345\"\"\"
776
-
let TripleInSingleInterpolated = $\"123{456}789{\"\"\"012\"\"\"}345\"
777
-
let TripleInVerbatimInterpolated = $\"123{456}789{\"\"\"012\"\"\"}345\"
778
-
let TripleInterpolatedInTripleInterpolated = $\"\"\"123{456}789{$\"\"\"012\"\"\"}345\"\"\"
779
-
let TripleInterpolatedInSingleInterpolated = $\"123{456}789{$\"\"\"012\"\"\"}345\"
780
-
let TripleInterpolatedInVerbatimInterpolated = $\"123{456}789{$\"\"\"012\"\"\"}345\"
"Invalid interpolated string. Single quote or verbatim string literals may not be used in interpolated expressions in single quote or verbatim strings. \
751
+
Consider using an explicit 'let' binding for the interpolation expression or use a triple quote string as the outer string literal.");
"Invalid interpolated string. Triple quote string literals may not be used in interpolated expressions. Consider using an explicit 'let' binding for the interpolation expression.");
786
-
(FSharpDiagnosticSeverity.Error,3374,(5,50,5,53),
787
-
"Invalid interpolated string. Triple quote string literals may not be used in interpolated expressions. Consider using an explicit 'let' binding for the interpolation expression.");
"Invalid interpolated string. Triple quote string literals may not be used in interpolated expressions. Consider using an explicit 'let' binding for the interpolation expression.");
790
-
(FSharpDiagnosticSeverity.Error,3374,(7,64,7,68),
791
-
"Invalid interpolated string. Triple quote string literals may not be used in interpolated expressions. Consider using an explicit 'let' binding for the interpolation expression.");
792
-
(FSharpDiagnosticSeverity.Error,3374,(8,62,8,66),
793
-
"Invalid interpolated string. Triple quote string literals may not be used in interpolated expressions. Consider using an explicit 'let' binding for the interpolation expression.");
794
-
(FSharpDiagnosticSeverity.Error,3374,(9,62,9,66),
795
-
"Invalid interpolated string. Triple quote string literals may not be used in interpolated expressions. Consider using an explicit 'let' binding for the interpolation expression.")|]
0 commit comments