Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit637c817

Browse files
authored
fix test and add lst.[0..x] test cases beside lst.[..x]
1 parent61232e1 commit637c817

File tree

1 file changed

+13
-3
lines changed
  • src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections

1 file changed

+13
-3
lines changed

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,24 @@ type ListType() =
245245
Assert.AreEqual(lst.[6..],([]: int list))
246246
CheckThrowsIndexOutRangException((fun _-> lst.[7..]|> ignore))
247247

248-
CheckThrowsIndexOutRangException((fun _-> lst.[..-1]|> ignore))
248+
249+
Assert.AreEqual(lst.[..-1],([]: int list))
249250
Assert.AreEqual(lst.[..0],[1])
250251
Assert.AreEqual(lst.[..1],[1;2])
251252
Assert.AreEqual(lst.[..2],[1;2;3])
252253
Assert.AreEqual(lst.[..3],[1;2;3;4])
253254
Assert.AreEqual(lst.[..4],[1;2;3;4;5])
254255
Assert.AreEqual(lst.[..5],[1;2;3;4;5;6])
255-
CheckThrowsIndexOutRangException((fun _-> lst.[..6]|> ignore))
256+
CheckThrowsIndexOutRangException((fun _-> lst.[..6]|> ignore))
257+
258+
Assert.AreEqual(lst.[0..-1],([]: int list))
259+
Assert.AreEqual(lst.[0..0],[1])
260+
Assert.AreEqual(lst.[0..1],[1;2])
261+
Assert.AreEqual(lst.[0..2],[1;2;3])
262+
Assert.AreEqual(lst.[0..3],[1;2;3;4])
263+
Assert.AreEqual(lst.[0..4],[1;2;3;4;5])
264+
Assert.AreEqual(lst.[0..5],[1;2;3;4;5;6])
265+
CheckThrowsIndexOutRangException((fun _-> lst.[0..6]|> ignore))
256266

257267
Assert.AreEqual(lst.[1..-1],([]: int list))
258268
Assert.AreEqual(lst.[1..0],([]: int list))
@@ -280,4 +290,4 @@ type ListType() =
280290
CheckThrowsIndexOutRangException((fun _-> empty.[..0]|> ignore))
281291
CheckThrowsIndexOutRangException((fun _-> empty.[0..0]|> ignore))
282292
CheckThrowsIndexOutRangException((fun _-> empty.[0..1]|> ignore))
283-
CheckThrowsIndexOutRangException((fun _-> empty.[3..5]|> ignore))
293+
CheckThrowsIndexOutRangException((fun _-> empty.[3..5]|> ignore))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp