test suite test runtime util
private class test1
public test1(integer i, string s)
this • i = i
this • s = s
private test1 v1
private test1 v2
private test1 v3
private test1 v4
test runtime util()
v1 = test1 • new(98, "asdf")
v2 = test1 • new(98, "asdf")
v3 = test1 • new(99, "asdf")
v4 = test1 • new(98, "asdfghj")
test case test class name()
assert runtime util • short class name(this) == "test_runtime_util"
assert runtime util • short class name("Hi") == "base_string"
test case test hash code()
hash1 : runtime util • compute hash code(v1)
hash2 : runtime util • compute hash code(v2)
hash3 : runtime util • compute hash code(v3)
hash4 : runtime util • compute hash code(v4)
assert hash1 == hash2
assert hash1 != hash3
assert hash1 != hash4
assert hash3 != hash4
test case test simple equals()
assert runtime util • values equal(v1, v2)
assert !runtime util • values equal(v1, v3)
assert !runtime util • values equal(v1, v4)
assert !runtime util • values equal(v4, v3)
assert v1 != v3
assert v1 != v4
assert v4 != v3
private immutable list[readonly data] make list(readonly data first, readonly data second)
the list : base list[readonly data] • new()
the list • append(first)
the list • append(second)
return the list • frozen copy()
test case test list equals()
assert runtime util • values equal(s1, s2)
assert !runtime util • values equal(s1, s3)
test case test equals()
assert runtime util • values equal("Hi", "Hi")
assert !runtime util • values equal("Hi", "Hello")
assert runtime util • values equal(null, null)
assert !runtime util • values equal(null, "foo")
assert !runtime util • values equal("bar", null)
test case test escape()
assert runtime util • escape markup("foo") == "foo"
assert runtime util • escape markup("hello! <>&") == "hello! &lt;&gt;&amp;"
assert runtime util • escape markup("1: ' 2: \"") == "1: &apos; 2: &quot;"