feat(short_sha): add a shortened sha commit id

This commit is contained in:
Antoine Méausoone
2019-11-11 15:53:51 +01:00
committed by Romain Lespinasse
parent 3876a4c025
commit d77acd4f47
3 changed files with 33 additions and 0 deletions

19
tests/short_sha.bats Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bats
@test "Short 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}" ]
}