mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-28 11:40:26 +01:00
b08d218a59
Currently tests only run on X11.64 platform. But other platforms can be supported with a bit of effort. Remove default bell sound as it does not play nicely with CI environment that does not have sound card.
31 lines
666 B
GDScript
31 lines
666 B
GDScript
extends "res://addons/gut/test.gd"
|
|
|
|
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 before_each():
|
|
assert(OS.set_environment(EMPTY_VAR, ""))
|
|
assert(OS.set_environment(TEST_VAR, TEST_VAL))
|
|
env = LibuvUtils.get_os_environ()
|
|
|
|
|
|
func test_has_empty_var():
|
|
assert_has(env, EMPTY_VAR)
|
|
|
|
|
|
func test_empty_var_has_empty_val():
|
|
assert_eq(env[EMPTY_VAR], "")
|
|
|
|
|
|
func test_has_test_var():
|
|
assert_has(env, TEST_VAR)
|
|
|
|
|
|
func test_test_var_has_correct_val():
|
|
assert_eq(env[TEST_VAR], TEST_VAL)
|