Skip to content

Commit dfd4521

Browse files
committed
Test fixes
1 parent 0ff6ac4 commit dfd4521

File tree

5 files changed

+16
-106
lines changed

5 files changed

+16
-106
lines changed

src/Compiler/pars.fsy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ let parse_error_rich = Some(fun (ctxt: ParseErrorContext<_>) ->
348348
%nonassoc interpolation_fill /* "...{3,N4}..." .NET style fill has higher precedence than "e COMMA e" */
349349
%nonassoc paren_pat_colon
350350
%nonassoc paren_pat_attribs
351-
%left BAR_BAR JOIN_IN
351+
%left OR BAR_BAR JOIN_IN
352+
%left AND
352353
%left AND_BANG
353354
%left AMP AMP_AMP
354355
%nonassoc pat_conj

tests/FSharp.Compiler.ComponentTests/Signatures/TestCasesForGenerationRoundTrip/libtest.fsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ let (:=) (r: 'T ref) (v: 'T) = r.Value <- v
88
let incr (r: int ref) = r.Value <- r.Value + 1
99
let decr (r: int ref) = r.Value <- r.Value - 1
1010

11-
#nowarn "62"
1211
#nowarn "44"
1312

1413
let failures = ref []
@@ -2021,7 +2020,7 @@ let _ = sort_test (fun x y -> -(compare x y)) [5;4;3;2;1;0]
20212020
*)
20222021
module StrangeOperatorTest =
20232022
let (&&&) x y = x+y
2024-
let (<<<) (x:string) (y:string) = x +y+x
2023+
let (<<<) (x:string) (y:string) = x + y + x
20252024

20262025
let e1 = ("0" &&& ("1" <<< "2"))
20272026
let e2= (("0" &&& "1") <<< "2")

tests/fsharp/core/patterns/test.fsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ module Core_patterns
1010
open System
1111
open System.Reflection
1212

13-
#light
14-
1513
let failures = ref []
1614

1715
let report_failure (s : string) =
@@ -888,7 +886,7 @@ module ActivePatternsFromTheHub =
888886

889887
let (|NightTime|_|) (time:System.DateTime) =
890888
let hourOfDay = time.TimeOfDay.Hours in
891-
predicate (hourOfDay < 5 or hourOfDay > 19)
889+
predicate (hourOfDay < 5 || hourOfDay > 19)
892890

893891
let (|International|_|) cc =
894892
predicate (cc <> "")

vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ let _ = (2 + 2) { return 5 }
21922192
match s[0], s with
21932193
| '*', _ when s.Length > 1 && s[1] = '*' -> "**op"
21942194
| ':', _
2195-
| _, ("$" | "||" | "or" | "&" | "&&") -> s
2195+
| _, ("$" | "||" | "&&") -> s
21962196
| '!', _ -> "!=op"
21972197
| c, _ -> $"{c}op"
21982198

@@ -2242,12 +2242,12 @@ let _ = (2 + 2) { return 5 }
22422242
| OuterLeft(_, ("=op" | "|op" | "&op" | "$" | ">op" | "<op" | "!=op")) -> fixable pair
22432243
| OuterLeft(("=op" | "|op" | "&op" | "$" | ">op" | "<op" | "!=op"), _) -> unfixable pair
22442244
| OuterLeft(_, (":>" | ":?>")) -> fixable pair
2245-
| OuterLeft(("&" | "&&"), ("&" | "&&")) -> if pair.Identical then fixable pair else unfixable pair
2246-
| OuterLeft(_, ("&" | "&&")) -> fixable pair
2247-
| OuterLeft(("&" | "&&"), _) -> unfixable pair
2248-
| OuterLeft(("||" | "or"), ("||" | "or")) -> if pair.Identical then fixable pair else unfixable pair
2249-
| OuterLeft(_, ("||" | "or")) -> fixable pair
2250-
| OuterLeft(("||" | "or"), _) -> unfixable pair
2245+
| OuterLeft("&&", "&&") -> fixable pair
2246+
| OuterLeft(_, "&&") -> fixable pair
2247+
| OuterLeft("&&", _) -> unfixable pair
2248+
| OuterLeft("||", "||") -> fixable pair
2249+
| OuterLeft(_, "||") -> fixable pair
2250+
| OuterLeft("||", _) -> unfixable pair
22512251
| OuterLeft(":=", ":=") -> fixable pair
22522252

22532253
| OuterRight((":?" | ":>" | ":?>"), _) -> invalidPairing
@@ -2267,10 +2267,10 @@ let _ = (2 + 2) { return 5 }
22672267
| OuterRight(("=op" | "|op" | "&op" | "$" | ">op" | "<op" | "!=op"), _) -> fixable pair
22682268
| OuterRight(_, ("=op" | "|op" | "&op" | "$" | ">op" | "<op" | "!=op")) -> unfixable pair
22692269
| OuterRight(_, (":>" | ":?>")) -> unfixable pair
2270-
| OuterRight(("&" | "&&"), _) -> fixable pair
2271-
| OuterRight(_, ("&" | "&&")) -> unfixable pair
2272-
| OuterRight(("||" | "or"), _) -> fixable pair
2273-
| OuterRight(_, ("||" | "or")) -> unfixable pair
2270+
| OuterRight("&&", _) -> fixable pair
2271+
| OuterRight(_, "&&") -> unfixable pair
2272+
| OuterRight("||", _) -> fixable pair
2273+
| OuterRight(_, "||") -> unfixable pair
22742274
| OuterRight(":=", ":=") -> unfixable pair
22752275

22762276
| _ -> unfixable pair
@@ -2303,9 +2303,7 @@ let _ = (2 + 2) { return 5 }
23032303
":>"
23042304
":?>"
23052305
"&&"
2306-
"&"
23072306
"||"
2308-
"or"
23092307
":="
23102308
]
23112309

vsintegration/tests/FSharp.Editor.Tests/SyntacticColorizationServiceTests.fs

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -660,91 +660,6 @@ type SyntacticClassificationServiceTests() =
660660
classificationType = ClassificationTypeNames.StringLiteral
661661
)
662662

663-
// Regression test for FSHARP1.0:4279
664-
[<Fact>]
665-
member this.Keyword_OCaml_asr() =
666-
this.VerifyColorizerAtStartOfMarker(
667-
fileContents =
668-
"""
669-
let foo a =
670-
match a with
671-
| Some(asr, b) -> ()
672-
|_ -> ()""",
673-
marker = "asr",
674-
defines = [],
675-
classificationType = ClassificationTypeNames.Keyword
676-
)
677-
678-
[<Fact>]
679-
member this.Keyword_OCaml_land() =
680-
this.VerifyColorizerAtStartOfMarker(
681-
fileContents =
682-
"""
683-
let foo a =
684-
match a with
685-
| Some(land, b) -> ()
686-
|_ -> ()""",
687-
marker = "land",
688-
defines = [],
689-
classificationType = ClassificationTypeNames.Keyword
690-
)
691-
692-
[<Fact>]
693-
member this.Keyword_OCaml_lor() =
694-
this.VerifyColorizerAtStartOfMarker(
695-
fileContents =
696-
"""
697-
let foo a =
698-
match a with
699-
| Some(lor, b) -> ()
700-
|_ -> ()""",
701-
marker = "lor",
702-
defines = [],
703-
classificationType = ClassificationTypeNames.Keyword
704-
)
705-
706-
[<Fact>]
707-
member this.Keyword_OCaml_lsl() =
708-
this.VerifyColorizerAtStartOfMarker(
709-
fileContents =
710-
"""
711-
let foo a =
712-
match a with
713-
| Some(lsl, b) -> ()
714-
|_ -> ()""",
715-
marker = "lsl",
716-
defines = [],
717-
classificationType = ClassificationTypeNames.Keyword
718-
)
719-
720-
[<Fact>]
721-
member this.Keyword_OCaml_lsr() =
722-
this.VerifyColorizerAtStartOfMarker(
723-
fileContents =
724-
"""
725-
let foo a =
726-
match a with
727-
| Some(lsr, b) -> ()
728-
|_ -> ()""",
729-
marker = "lsr",
730-
defines = [],
731-
classificationType = ClassificationTypeNames.Keyword
732-
)
733-
734-
[<Fact>]
735-
member this.Keyword_OCaml_lxor() =
736-
this.VerifyColorizerAtStartOfMarker(
737-
fileContents =
738-
"""
739-
let foo a =
740-
match a with
741-
| Some(lxor, b) -> ()
742-
|_ -> ()""",
743-
marker = "lxor",
744-
defines = [],
745-
classificationType = ClassificationTypeNames.Keyword
746-
)
747-
748663
[<Fact>]
749664
member this.Keyword_OCaml_mod() =
750665
this.VerifyColorizerAtStartOfMarker(
@@ -1075,7 +990,6 @@ type SyntacticClassificationServiceTests() =
1075990
/// FEATURE: Preprocessor keywords #light\#if\#else\#endif are colored with the PreprocessorKeyword color.
1076991
/// FEATURE: All code in the inactive side of #if\#else\#endif is colored with the InactiveCode color.
1077992
[<Theory>]
1078-
[<InlineData("light (*Light*)", ClassificationTypeNames.PreprocessorKeyword)>]
1079993
[<InlineData("(*Inactive*)", ClassificationTypeNames.ExcludedCode)>]
1080994
[<InlineData("if UNDEFINED //(*If*)", ClassificationTypeNames.PreprocessorKeyword)>]
1081995
[<InlineData("FINED //(*If*)", ClassificationTypeNames.Identifier)>]
@@ -1088,7 +1002,7 @@ type SyntacticClassificationServiceTests() =
10881002
member public this.Preprocessor_Keywords(marker: string, classificationType: string) =
10891003
this.VerifyColorizerAtStartOfMarker(
10901004
fileContents =
1091-
"#light (*Light*)
1005+
"
10921006
#if UNDEFINED //(*If*)
10931007
let x = 1(*Inactive*)
10941008
#else //(*Else*)

0 commit comments

Comments
 (0)