Skip to content

Commit 662ec9c

Browse files
committed
Reformat list tests for clarity
1 parent 8da3fac commit 662ec9c

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

test/gleam/list_test.gleam

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -352,39 +352,50 @@ pub fn repeat_test() {
352352
}
353353

354354
pub fn split_test() {
355-
list.split([], 0)
355+
[]
356+
|> list.split(_, 0)
356357
|> expect.equal(_, struct([], []))
357358

358-
list.split([0, 1, 2, 3, 4], 0)
359+
[0, 1, 2, 3, 4]
360+
|> list.split(_, 0)
359361
|> expect.equal(_, struct([], [0, 1, 2, 3, 4]))
360362

361-
list.split([0, 1, 2, 3, 4], -2)
363+
[0, 1, 2, 3, 4]
364+
|> list.split(_, -2)
362365
|> expect.equal(_, struct([], [0, 1, 2, 3, 4]))
363366

364-
list.split([0, 1, 2, 3, 4], 1)
367+
[0, 1, 2, 3, 4]
368+
|> list.split(_, 1)
365369
|> expect.equal(_, struct([0], [1, 2, 3, 4]))
366370

367-
list.split([0, 1, 2, 3, 4], 3)
371+
[0, 1, 2, 3, 4]
372+
|> list.split(_, 3)
368373
|> expect.equal(_, struct([0, 1, 2], [3, 4]))
369374

370-
list.split([0, 1, 2, 3, 4], 9)
375+
[0, 1, 2, 3, 4]
376+
|> list.split(_, 9)
371377
|> expect.equal(_, struct([0, 1, 2, 3, 4], []))
372378
}
373379

374380
pub fn split_while_test() {
375-
list.split_while([], fn(x) { x <= 5 })
381+
[]
382+
|> list.split_while(_, fn(x) { x <= 5 })
376383
|> expect.equal(_, struct([], []))
377384

378-
list.split_while([1, 2, 3, 4, 5], fn(x) { x <= 5 })
385+
[1, 2, 3, 4, 5]
386+
|> list.split_while(_, fn(x) { x <= 5 })
379387
|> expect.equal(_, struct([1, 2, 3, 4, 5], []))
380388

381-
list.split_while([1, 2, 3, 4, 5], fn(x) { x == 2 })
389+
[1, 2, 3, 4, 5]
390+
|> list.split_while(_, fn(x) { x == 2 })
382391
|> expect.equal(_, struct([], [1, 2, 3, 4, 5]))
383392

384-
list.split_while([1, 2, 3, 4, 5], fn(x) { x <= 3 })
393+
[1, 2, 3, 4, 5]
394+
|> list.split_while(_, fn(x) { x <= 3 })
385395
|> expect.equal(_, struct([1, 2, 3], [4, 5]))
386396

387-
list.split_while([1, 2, 3, 4, 5], fn(x) { x <= -3 })
397+
[1, 2, 3, 4, 5]
398+
|> list.split_while(_, fn(x) { x <= -3 })
388399
|> expect.equal(_, struct([], [1, 2, 3, 4, 5]))
389400
}
390401

0 commit comments

Comments
 (0)