Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Test-a-function/Brat/test-a-function.brat
Normal file
24
Task/Test-a-function/Brat/test-a-function.brat
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
include :assert
|
||||
|
||||
palindrome? = { str |
|
||||
str = str.downcase.sub /\s+/ ""
|
||||
str == str.reverse
|
||||
}
|
||||
|
||||
setup name: "palindrome test" {
|
||||
test "is a palindrome" {
|
||||
assert { palindrome? "abba" }
|
||||
}
|
||||
|
||||
test "is not a palindrome" {
|
||||
assert_false { palindrome? "abb" }
|
||||
}
|
||||
|
||||
test "is not a string" {
|
||||
assert_fail { palindrome? 1001 }
|
||||
}
|
||||
|
||||
test "this test fails" {
|
||||
assert { palindrome? "blah blah" }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue