2021-07-18 14:15:08 +02:00
|
|
|
extends "res://addons/gut/test.gd"
|
2021-07-03 15:54:34 +02:00
|
|
|
|
|
|
|
const EMPTY_VAR = "GODOT_XTERM_TEST_EMPTY_ENV_VAR"
|
|
|
|
const TEST_VAR = "GODOT_XTERM_TEST_ENV_VAR"
|
|
|
|
const TEST_VAL = "TEST123"
|
|
|
|
|
|
|
|
var env: Dictionary
|
|
|
|
|
|
|
|
|
2021-07-18 14:15:08 +02:00
|
|
|
func before_each():
|
2024-01-06 11:27:15 +01:00
|
|
|
OS.set_environment(EMPTY_VAR, "")
|
|
|
|
OS.set_environment(TEST_VAR, TEST_VAL)
|
2021-07-03 15:54:34 +02:00
|
|
|
env = LibuvUtils.get_os_environ()
|
|
|
|
|
|
|
|
|
|
|
|
func test_has_empty_var():
|
2021-07-18 14:15:08 +02:00
|
|
|
assert_has(env, EMPTY_VAR)
|
2021-07-03 15:54:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
func test_empty_var_has_empty_val():
|
2021-07-18 14:15:08 +02:00
|
|
|
assert_eq(env[EMPTY_VAR], "")
|
2021-07-03 15:54:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
func test_has_test_var():
|
2021-07-18 14:15:08 +02:00
|
|
|
assert_has(env, TEST_VAR)
|
2021-07-03 15:54:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
func test_test_var_has_correct_val():
|
2021-07-18 14:15:08 +02:00
|
|
|
assert_eq(env[TEST_VAR], TEST_VAL)
|