Skip to content
This repository was archived by the owner on Oct 31, 2021. It is now read-only.

Commit 1919a70

Browse files
fix SymbolClassifierTests regarding printf formatters range
1 parent 46313b5 commit 1919a70

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

tests/FSharp.Editing.Tests/SymbolClassifierTests.fs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -890,8 +890,8 @@ let _ = printfn "%s %s"
890890
do printfn "%6d %% % 06d" 1 2
891891
"""
892892
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15 ]
893-
3, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 17, 19; Cat.Printf, 20, 22 ]
894-
4, [ Cat.Function, 3, 10; Cat.Printf, 12, 15; Cat.Printf, 16, 18; Cat.Printf, 20, 25 ]]
893+
3, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 17, 20; Cat.Printf, 20, 23 ]
894+
4, [ Cat.Function, 3, 10; Cat.Printf, 12, 16; Cat.Printf, 16, 19; Cat.Printf, 20, 26 ]]
895895

896896
[<Test>]
897897
let ``printf formatters in try / with / finally``() =
@@ -905,10 +905,10 @@ try
905905
with _ ->
906906
failwithf "foo %d bar" 0
907907
"""
908-
=> [ 3, [ Cat.Operator, 10, 11; Cat.Function, 12, 19; Cat.Printf, 25, 27 ]
909-
5, [ Cat.Function, 8, 15; Cat.Printf, 21, 23 ]
910-
7, [ Cat.Function, 8, 14; Cat.Printf, 20, 22 ]
911-
9, [ Cat.Function, 4, 13; Cat.Printf, 19, 21 ]]
908+
=> [ 3, [ Cat.Operator, 10, 11; Cat.Function, 12, 19; Cat.Printf, 25, 28 ]
909+
5, [ Cat.Function, 8, 15; Cat.Printf, 21, 24 ]
910+
7, [ Cat.Function, 8, 14; Cat.Printf, 20, 23 ]
911+
9, [ Cat.Function, 4, 13; Cat.Printf, 19, 22 ]]
912912

913913
[<Test>]
914914
let ``printf formatters in record / DU members``() =
@@ -926,10 +926,10 @@ type DU = DU
926926
override __.ToString() =
927927
sprintf "%d" 1
928928
"""
929-
=> [ 5, [ Cat.Function, 12, 19; Cat.Printf, 21, 23 ]
930-
7, [ Cat.Function, 12, 19; Cat.Printf, 21, 23 ]
931-
11, [ Cat.Function, 12, 19; Cat.Printf, 21, 23 ]
932-
13, [ Cat.Function, 12, 19; Cat.Printf, 21, 23 ]]
929+
=> [ 5, [ Cat.Function, 12, 19; Cat.Printf, 21, 24 ]
930+
7, [ Cat.Function, 12, 19; Cat.Printf, 21, 24 ]
931+
11, [ Cat.Function, 12, 19; Cat.Printf, 21, 24 ]
932+
13, [ Cat.Function, 12, 19; Cat.Printf, 21, 24 ]]
933933

934934
[<Test>]
935935
let ``printf formatters in extension members``() =
@@ -938,19 +938,19 @@ type System.Object with
938938
member __.M1 =
939939
sprintf "%A"
940940
"""
941-
=> [ 4, [ Cat.Function, 8, 15; Cat.Printf, 17, 19 ]]
941+
=> [ 4, [ Cat.Function, 8, 15; Cat.Printf, 17, 20 ]]
942942

943943
[<Test>]
944944
let ``printf formatters in escaped string``() =
945945
"""
946946
let _ = sprintf @"%A"
947947
"""
948-
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 18, 20 ]]
948+
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 18, 21 ]]
949949

950950
[<Test>]
951951
let ``printf formatters in triple-quoted string``() =
952952
"let _ = sprintf \"\"\"%A\"\"\""
953-
=> [ 1, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 19, 21 ]]
953+
=> [ 1, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 19, 22 ]]
954954

955955
[<Test>]
956956
let ``multi-line printf formatters``() =
@@ -959,9 +959,9 @@ let _ = printfn "foo %s %d
959959
%A bar
960960
%i"
961961
"""
962-
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 21, 23; Cat.Printf, 24, 26 ]
963-
3, [ Cat.Printf, 17, 19 ]
964-
4, [ Cat.Printf, 0, 2 ] ]
962+
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 21, 24; Cat.Printf, 24, 27 ]
963+
3, [ Cat.Printf, 17, 20 ]
964+
4, [ Cat.Printf, 0, 3 ] ]
965965

966966
[<Test>]
967967
let ``printf formatters in for expressions``() =
@@ -974,18 +974,18 @@ for _ in (sprintf "%d" 1).ToCharArray() do
974974
|> ignore
975975
976976
"""
977-
=> [ 2, [ Cat.Function, 10, 17; Cat.Printf, 19, 21; Cat.Function, 26, 37 ]
978-
3, [ Cat.Function, 4, 11; Cat.Printf, 13, 15]
979-
5, [ Cat.Function, 12, 19; Cat.Printf, 21, 23; Cat.Function, 28, 39 ]
980-
6, [ Cat.Function, 10, 17; Cat.Printf, 19, 21]
977+
=> [ 2, [ Cat.Function, 10, 17; Cat.Printf, 19, 22; Cat.Function, 26, 37 ]
978+
3, [ Cat.Function, 4, 11; Cat.Printf, 13, 16]
979+
5, [ Cat.Function, 12, 19; Cat.Printf, 21, 24; Cat.Function, 28, 39 ]
980+
6, [ Cat.Function, 10, 17; Cat.Printf, 19, 22]
981981
]
982982

983983
[<Test>]
984984
let ``printf formatters in quoted expressions``() =
985985
"""
986986
let _ = <@ sprintf "%A" @>
987987
"""
988-
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 11, 18; Cat.Printf, 20, 22; Cat.Quotation, 8, 26 ]]
988+
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 11, 18; Cat.Printf, 20, 23; Cat.Quotation, 8, 26 ]]
989989

990990
[<Test>]
991991
let ``printf formatters if printf function is namespace qualified``() =
@@ -994,8 +994,8 @@ let _ = Microsoft.FSharp.Core.Printf.printf "%A" 0
994994
open Microsoft.FSharp.Core
995995
let _ = Printf.printf "%A" 0
996996
"""
997-
=> [ 2, [ Cat.Operator, 6, 7; Cat.Module, 30, 36; Cat.Function, 37, 43; Cat.Printf, 45, 47 ]
998-
4, [ Cat.Operator, 6, 7; Cat.Module, 8, 14; Cat.Function, 15, 21; Cat.Printf, 23, 25 ]]
997+
=> [ 2, [ Cat.Operator, 6, 7; Cat.Module, 30, 36; Cat.Function, 37, 43; Cat.Printf, 45, 48 ]
998+
4, [ Cat.Operator, 6, 7; Cat.Module, 8, 14; Cat.Function, 15, 21; Cat.Printf, 23, 26 ]]
999999

10001000
[<Test>]
10011001
let ``printf formatters are not colorized in plane strings``() =
@@ -1011,34 +1011,34 @@ let _ = fprintf null "%A" 0
10111011
let _ = Microsoft.FSharp.Core.Printf.fprintf null "%A" 0
10121012
let _ = fprintfn null "%A" 0
10131013
"""
1014-
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 22, 24 ]
1015-
3, [ Cat.Operator, 6, 7; Cat.Module, 30, 36; Cat.Function, 37, 44; Cat.Printf, 51, 53 ]
1016-
4, [ Cat.Operator, 6, 7; Cat.Function, 8, 16; Cat.Printf, 23, 25 ]]
1014+
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 22, 25 ]
1015+
3, [ Cat.Operator, 6, 7; Cat.Module, 30, 36; Cat.Function, 37, 44; Cat.Printf, 51, 54 ]
1016+
4, [ Cat.Operator, 6, 7; Cat.Function, 8, 16; Cat.Printf, 23, 26 ]]
10171017

10181018
[<Test>]
10191019
let ``kprintf and bprintf formatters``() =
10201020
"""
10211021
let _ = Printf.kprintf (fun _ -> ()) "%A" 1
10221022
let _ = Printf.bprintf null "%A" 1
10231023
"""
1024-
=> [ 2, [ Cat.Operator, 6, 7; Cat.Module, 8, 14; Cat.Function, 15, 22; Cat.Printf, 38, 40]
1025-
3, [ Cat.Operator, 6, 7; Cat.Module, 8, 14; Cat.Function, 15, 22; Cat.Printf, 29, 31]]
1024+
=> [ 2, [ Cat.Operator, 6, 7; Cat.Module, 8, 14; Cat.Function, 15, 22; Cat.Printf, 38, 41]
1025+
3, [ Cat.Operator, 6, 7; Cat.Module, 8, 14; Cat.Function, 15, 22; Cat.Printf, 29, 32]]
10261026

10271027
[<Test>]
10281028
let ``wildcards in printf formatters``() =
10291029
"""
10301030
let _ = sprintf "%*d" 1
10311031
"""
1032-
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 17, 20 ]]
1032+
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 17, 21 ]]
10331033

10341034
[<Test>]
10351035
let ``float printf formatters``() =
10361036
"""
10371037
let _ = sprintf "%7.1f" 1.0
10381038
let _ = sprintf "%-8.1e+567" 1.0
10391039
"""
1040-
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 17, 22]
1041-
3, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 17, 23]]
1040+
=> [ 2, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 17, 23]
1041+
3, [ Cat.Operator, 6, 7; Cat.Function, 8, 15; Cat.Printf, 17, 24]]
10421042

10431043
[<Test>]
10441044
let ``malformed printf formatters``() =

0 commit comments

Comments
 (0)