Skip to content

Commit 22546ca

Browse files
committed
Split tests into several files
1 parent feb0b67 commit 22546ca

File tree

6 files changed

+365
-365
lines changed

6 files changed

+365
-365
lines changed

spec/stdlib/all.lit

Lines changed: 0 additions & 365 deletions
This file was deleted.

spec/stdlib/array.lit

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import "test_runner"
2+
3+
TestRunner().describe("Lit Array", fn { |t|
4+
t.test("#is_empty? when array is empty", fn { |should|
5+
[].is_empty?() |> should.eq(true)
6+
})
7+
t.test("#is_empty? when array is not empty", fn { |should|
8+
[1].is_empty?() |> should.eq(false)
9+
})
10+
t.test("#first when array is empty", fn { |should|
11+
[].first() |> should.eq(nil)
12+
})
13+
t.test("#first when array is not empty", fn { |should|
14+
[1].first() |> should.eq(1)
15+
})
16+
t.test("#sample returns a random element of the array", fn { |should|
17+
let array = [1, 2, 3, 4, 5]
18+
array.sample() |> should.be_in(array)
19+
})
20+
}).run()

0 commit comments

Comments
 (0)