godot-xterm/test/integration/uv_utils.test.gd
Leroy Hopson 115521f645
Replace Gut with WAT
Gut was freezing on some integration tests. It was also entering an
infinite loop after exiting (even after closing Godot and VSCode) which
caused a `godot.log` file in app_userdata to keep growing until my hard
drive was full.
2021-07-03 21:49:24 +07:00

31 lines
656 B
GDScript

extends WAT.Test
const LibuvUtils = preload("res://addons/godot_xterm/nodes/pty/libuv_utils.gd")
const EMPTY_VAR = "GODOT_XTERM_TEST_EMPTY_ENV_VAR"
const TEST_VAR = "GODOT_XTERM_TEST_ENV_VAR"
const TEST_VAL = "TEST123"
var env: Dictionary
func pre():
assert(OS.set_environment(EMPTY_VAR, ""))
assert(OS.set_environment(TEST_VAR, TEST_VAL))
env = LibuvUtils.get_os_environ()
func test_has_empty_var():
asserts.has(EMPTY_VAR, env)
func test_empty_var_has_empty_val():
asserts.is_equal(env[EMPTY_VAR], "")
func test_has_test_var():
asserts.has(TEST_VAR, env)
func test_test_var_has_correct_val():
asserts.is_equal(env[TEST_VAR], TEST_VAL)