File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
tests/FSharpLint.Core.Tests/Rules/Hints Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 410410 " false <> a ===> a" ,
411411 " if a then true else false ===> a" ,
412412 " if a then false else true ===> not a" ,
413+ " if x then y else y ===> y" ,
413414 " not (not x) ===> x" ,
414415
415416 " (fst x, snd x) ===> x" ,
Original file line number Diff line number Diff line change @@ -953,4 +953,21 @@ let x y =
953953
954954 this.SetConfig([ " List.map f (List.map g x) ===> List.map (g >> f) x" ])
955955 this.Parse( source)
956- Assert.AreEqual( expected, this.ApplyQuickFix source)
956+ Assert.AreEqual( expected, this.ApplyQuickFix source)
957+
958+ [<Test>]
959+ member this. ``Result same regardless of condition can remove conditional block`` () =
960+ let source = """
961+ if (someCondition a b) then
962+ res
963+ else
964+ res
965+ """
966+
967+ let expected = """
968+ res
969+ """
970+
971+ this.SetConfig([ " if x then y else y ===> y" ])
972+ this.Parse( source)
973+ Assert.AreEqual( expected, this.ApplyQuickFix source)
You can’t perform that action at this time.
0 commit comments