-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.test
More file actions
executable file
·25 lines (20 loc) · 805 Bytes
/
example.test
File metadata and controls
executable file
·25 lines (20 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
source testing.bash
TestExample_logs() {
log "Hello World! I am a test."
log "Usually you won't see any of these logs, unless the test fails."
log "You can opt to always see them with the -v flag or by setting VERBOSE=YES"
log "Logs are passed through printf, so you can do things like %s!" this
log "Logs also print the file and line number they came from."
log "Since this test just writes logs, it will succeed, yay!"
}
TestExample_errors() {
error "This is an error :("
error "The error function is very similar to the log function."
error "Except it causes the test to be marked as failed."
error "Bad %s!" test
}
TestExample_fatal() {
fatal "This is a fatal error. The test will end right here in a failed state."
log "You will not see this line."
}