1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-11 00:00:06 +00:00

Add tests for setting the right locale in icons.zsh

This commit is contained in:
Dominik Ritter 2017-03-18 20:08:56 +01:00
parent d9374412e6
commit 41d92371ae
2 changed files with 75 additions and 1 deletions

View file

@ -21,9 +21,9 @@ script:
- test/powerlevel9k.spec
- test/functions/utilities.spec
- test/functions/colors.spec
- test/functions/icons.spec
- test/segments/command_execution_time.spec
- test/segments/dir.spec
- test/segments/rust_version.spec
- test/segments/go_version.spec
- test/segments/vcs.spec

74
test/functions/icons.spec Executable file
View file

@ -0,0 +1,74 @@
#!/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 setUp() {
# Store old value for LC_CTYPE
_OLD_LC_CTYPE="${LC_CTYPE}"
# Reset actual LC_CTYPE
unset LC_CTYPE
# Store old P9K mode
_OLD_P9K_MODE="${POWERLEVEL9K_MODE}"
}
function tearDown() {
# Restore LC_CTYPE
LC_CTYPE="${_OLD_LC_CTYPE}"
# Restore old P9K mode
POWERLEVEL9K_MODE="${_OLD_P9K_MODE}"
}
function testLcCtypeIsSetCorrectlyInDefaultMode() {
POWERLEVEL9K_MODE="default"
# Load Powerlevel9k
source functions/icons.zsh
assertEquals 'en_US.UTF-8' "${LC_CTYPE}"
}
function testLcCtypeIsSetCorrectlyInAwesomePatchedMode() {
POWERLEVEL9K_MODE="awesome-patched"
# Load Powerlevel9k
source functions/icons.zsh
assertEquals 'en_US.UTF-8' "${LC_CTYPE}"
}
function testLcCtypeIsSetCorrectlyInAwesomeFontconfigMode() {
POWERLEVEL9K_MODE="awesome-fontconfig"
# Load Powerlevel9k
source functions/icons.zsh
assertEquals 'en_US.UTF-8' "${LC_CTYPE}"
}
function testLcCtypeIsSetCorrectlyInNerdfontFontconfigMode() {
POWERLEVEL9K_MODE="nerdfont-fontconfig"
# Load Powerlevel9k
source functions/icons.zsh
assertEquals 'en_US.UTF-8' "${LC_CTYPE}"
}
function testLcCtypeIsSetCorrectlyInFlatMode() {
POWERLEVEL9K_MODE="flat"
# Load Powerlevel9k
source functions/icons.zsh
assertEquals 'en_US.UTF-8' "${LC_CTYPE}"
}
function testLcCtypeIsSetCorrectlyInCompatibleMode() {
POWERLEVEL9K_MODE="compatible"
# Load Powerlevel9k
source functions/icons.zsh
assertEquals 'en_US.UTF-8' "${LC_CTYPE}"
}
source shunit2/source/2.1/src/shunit2