mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-05-18 02:55:09 +00:00
BREAKING CHANGE: The previous slug function is rename slug_url to be able to still use itin the subdomain of an url. Co-authored-by: Marc Schiller <m4rc.schiller@gmail.com>
20 lines
380 B
Bash
20 lines
380 B
Bash
#!/usr/bin/env bats
|
|
|
|
@test "short_sha: long hash" {
|
|
test_short_sha \
|
|
"a35a1a486a260cfd99c5b6f8c6034a2929ba9b3f" \
|
|
"a35a1a48"
|
|
}
|
|
|
|
# Load sluf_ref function
|
|
source entrypoint.sh > /dev/null 2>&1
|
|
|
|
test_short_sha(){
|
|
given="${1}"
|
|
expected="${2}"
|
|
|
|
actual="$(short_sha ${given})"
|
|
echo "expected : [${expected}], actual : [${actual}]"
|
|
[ "${actual}" == "${expected}" ]
|
|
}
|