File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- fn CheckPrime (n: int): bool {
1+ fn Prime (n: int): bool {
22 if n <= 1 {
33 return false
44 }
Original file line number Diff line number Diff line change 33use "std/testing"
44
55#test
6- fn testCheckPrime (t: &testing::T) {
7- t.Assert(!CheckPrime (-7), "-7 should not be prime")
8- t.Assert(!CheckPrime (0), "0 should not be prime")
9- t.Assert(!CheckPrime (1), "1 should not be prime")
10- t.Assert(CheckPrime (2), "2 should be prime")
11- t.Assert(CheckPrime (3), "3 should be prime")
12- t.Assert(!CheckPrime (4), "4 should not be prime")
13- t.Assert(CheckPrime (97), "97 should be prime")
14- t.Assert(!CheckPrime (100), "100 should not be prime")
6+ fn testPrime (t: &testing::T) {
7+ t.Assert(!Prime (-7), "-7 should not be prime")
8+ t.Assert(!Prime (0), "0 should not be prime")
9+ t.Assert(!Prime (1), "1 should not be prime")
10+ t.Assert(Prime (2), "2 should be prime")
11+ t.Assert(Prime (3), "3 should be prime")
12+ t.Assert(!Prime (4), "4 should not be prime")
13+ t.Assert(Prime (97), "97 should be prime")
14+ t.Assert(!Prime (100), "100 should not be prime")
1515}
You can’t perform that action at this time.
0 commit comments