mirror of https://github.com/pixelfed/pixelfed
add bats testing
parent
e70e13e265
commit
2d05eccb87
@ -0,0 +1,10 @@
|
||||
|
||||
[submodule "tests/shell/bats"]
|
||||
path = tests/shell/bats
|
||||
url = https://github.com/bats-core/bats-core.git
|
||||
[submodule "tests/shell/test_helper/bats-support"]
|
||||
path = tests/shell/test_helper/bats-support
|
||||
url = https://github.com/bats-core/bats-support.git
|
||||
[submodule "tests/shell/test_helper/bats-assert"]
|
||||
path = tests/shell/test_helper/bats-assert
|
||||
url = https://github.com/bats-core/bats-assert.git
|
@ -0,0 +1,74 @@
|
||||
setup() {
|
||||
DIR="$(cd "$(dirname "${BATS_TEST_FILENAME:-}")" >/dev/null 2>&1 && pwd)"
|
||||
ROOT="$(dirname "$(dirname "$DIR")")"
|
||||
|
||||
load "$ROOT/docker/shared/root/docker/helpers.sh"
|
||||
}
|
||||
|
||||
@test "test [is-true]" {
|
||||
is-true "1"
|
||||
is-true "true"
|
||||
is-true "TrUe"
|
||||
}
|
||||
|
||||
@test "test [is-false]" {
|
||||
is-false "0"
|
||||
is-false "false"
|
||||
is-false "FaLsE"
|
||||
}
|
||||
|
||||
@test "test [is-false-expressions-0]" {
|
||||
if is-false "0"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@test "test [is-false-expressions-false]" {
|
||||
if is-false "false"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@test "test [is-false-expressions-FaLse]" {
|
||||
if is-false "FaLse"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@test "test [is-false-expressions-invalid]" {
|
||||
if is-false "invalid"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@test "test [is-true-expressions-1]" {
|
||||
if is-true "1"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@test "test [is-true-expressions-true]" {
|
||||
if is-true "true"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@test "test [is-true-expressions-TrUE]" {
|
||||
if is-true "TrUE"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
Loading…
Reference in New Issue