Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-English based system languages cause the failure of running the test driver #135

Open
yuhow opened this issue Jan 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@yuhow
Copy link
Contributor

yuhow commented Jan 10, 2023

My current system default language is traditional Chinese.
By running the unit test of devenv, I would have the following output messages:


*** test file: test_init_var.sh
test_devenvroot
test_devenvflavor
test_devenvflavorroot
test_devenvcurrentroot
test_devenvlibrary_path_backup
test_devenvpath_backup
test_devenvprefix
test_devenvdlroot

Ran 8 tests.

OK
*** test file: test_bash_utils.sh
test_display_type
ASSERT:expected:<denenv_display is a function> but was:<>
shunit2:ERROR test_display_type() returned non-zero return code.
test_display
test_display_e
devenv shunit2 unittest
test_get_cmd_list
test_get_build_list
test_get_application_list
test_get_flavor_list

Ran 7 tests.

FAILED (failures=2)
*** test file: test_devenv_impl.sh
test_namemunge
test_nameremove

Ran 2 tests.

OK


By further checking the error message, we could know the failure was from test function 'test_display_type()' in tests/test_bash_utils.sh


test_display_type() {
expected=display is a function"
actual=$(type display | grep "is a")
assertEquals "${expected}" "${actual}"
}


This function tried to check the output of the following command:
$ type display

The expected output message requested by the unit test should be 'display is a function'

Since my system default language was traditional Chinese, the output message would be 'display 是一個函數'

So the unit test would be failed due to non-English system language.

@yungyuc yungyuc added the bug Something isn't working label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants