mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-26 05:50:07 +00:00
Add unit tests for printSizeHumanReadable
This commit is contained in:
parent
be0dce7ff6
commit
ca6cbaa0b6
2 changed files with 23 additions and 0 deletions
|
@ -19,4 +19,5 @@ install:
|
|||
|
||||
script:
|
||||
- test/powerlevel9k.spec
|
||||
- test/functions/utilities.spec
|
||||
|
||||
|
|
22
test/functions/utilities.spec
Executable file
22
test/functions/utilities.spec
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env zsh
|
||||
#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
|
||||
|
||||
# Required for shunit2 to run correctly
|
||||
setopt shwordsplit
|
||||
SHUNIT_PARENT=$0
|
||||
|
||||
function oneTimeSetUp() {
|
||||
# Load Powerlevel9k
|
||||
source functions/utilities.zsh
|
||||
}
|
||||
|
||||
function testPrintSizeHumanReadableWithBigNumber() {
|
||||
# Interesting: Currently we can't support numbers bigger than that.
|
||||
assertEquals '0.87E' "$(printSizeHumanReadable 1000000000000000000)"
|
||||
}
|
||||
|
||||
function testPrintSizeHumanReadableWithExabytesAsBase() {
|
||||
assertEquals '9.77Z' "$(printSizeHumanReadable 10000 'E')"
|
||||
}
|
||||
|
||||
source shunit2/source/2.1/src/shunit2
|
Loading…
Reference in a new issue