Skip to content

Commit 7d9ccd1

Browse files
committed
minor
1 parent b7f18da commit 7d9ccd1

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Formlets.Tests/FormletsTests.fs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ let radioRefill() =
8383
let input1 = r.[0]
8484
let input2 = r.[2]
8585
match input1 with
86-
| TagA(_,attr,_) -> Assert.False(Seq.exists (fun (k,_) -> k = "checked") attr)
86+
| TagA(_,attr,_) -> Assert.False(Seq.exists (fst >> (=) "checked") attr)
8787
| _ -> failwith "err"
8888
match input2 with
89-
| TagA(_,attr,_) -> Assert.True(Seq.exists (fun (k,_) -> k = "checked") attr)
89+
| TagA(_,attr,_) -> Assert.True(Seq.exists (fst >> (=) "checked") attr)
9090
| _ -> failwith "err"
9191

9292
[<Fact>]
@@ -96,7 +96,7 @@ let checkboxRefill() =
9696
let r = run formlet env |> fst3
9797
printfn "%A" r
9898
match r.[0] with
99-
| TagA(_,attr,_) -> Assert.True(Seq.exists (fun (k,_) -> k = "checked") attr)
99+
| TagA(_,attr,_) -> Assert.True(Seq.exists (fst >> (=) "checked") attr)
100100
| _ -> failwith "err"
101101

102102
[<Fact>]
@@ -105,7 +105,7 @@ let inputRefill() =
105105
let r = run input env |> fst3
106106
printfn "%A" r
107107
match r.[0] with
108-
| TagA(_,attr,_) -> Assert.True(Seq.exists (fun (k,v) -> k = "value" && v = "pepe") attr)
108+
| TagA(_,attr,_) -> Assert.True(Seq.exists ((=)("value","pepe")) attr)
109109
| _ -> failwith "err"
110110

111111
[<Fact>]
@@ -264,7 +264,7 @@ let ``NameValueCollection to seq does not ignore duplicate keys``() =
264264
e.Add("1", "one")
265265
e.Add("1", "uno")
266266
let values = NameValueCollection.toSeq e
267-
let values = values |> Seq.filter (fun (k,_) -> k = "1") |> Seq.toList
267+
let values = values |> Seq.filter (fst >> (=) "1") |> Seq.toList
268268
Assert.Equal(2, values.Length)
269269

270270
[<Fact>]
@@ -560,9 +560,8 @@ let ``Color serialize``() =
560560

561561
[<Fact>]
562562
let ``Color deserialize ok``() =
563-
let color = colorSerializer.TryDeserialize "#FF3A3B"
564-
Assert.True(fst color)
565-
let color = snd color
563+
let ok,color = colorSerializer.TryDeserialize "#FF3A3B"
564+
Assert.True ok
566565
Assert.Equal(0xFFuy, color.R)
567566
Assert.Equal(0x3Auy, color.G)
568567
Assert.Equal(0x3Buy, color.B)
@@ -584,7 +583,6 @@ let ``function pickle``() =
584583
match run f env with
585584
| Success ff -> Assert.Equal(5, ff 2 3)
586585
| _ -> failwith "should not have failed"
587-
()
588586

589587
[<Fact>]
590588
let ``bin serializer string``() =

0 commit comments

Comments
 (0)