import lib // --- escape edge cases --- fn test_escape_all_chars(): Unit with {Test} = { Test.assertEqualMsg("&", lib.escape("&"), "escape ampersand") Test.assertEqualMsg("<", lib.escape("<"), "escape less-than") Test.assertEqualMsg(">", lib.escape(">"), "escape greater-than") Test.assertEqualMsg(""", lib.escape("\""), "escape double quote") Test.assertEqualMsg("'", lib.escape("'"), "escape single quote") } fn test_escape_empty(): Unit with {Test} = Test.assertEqualMsg("", lib.escape(""), "escape empty string") fn test_escape_no_special(): Unit with {Test} = Test.assertEqualMsg("hello world 123", lib.escape("hello world 123"), "escape plain text unchanged") fn test_escape_all_special(): Unit with {Test} = Test.assertEqualMsg("<&>"'", lib.escape("<&>\"'"), "escape all special chars together") fn test_escape_mixed(): Unit with {Test} = Test.assertEqualMsg("a & b < c", lib.escape("a & b < c"), "escape mixed content") // --- node constructors --- fn test_text_node_simple(): Unit with {Test} = Test.assertEqualMsg("hello", lib.render(lib.text("hello")), "text node renders content") fn test_text_node_escapes(): Unit with {Test} = Test.assertEqualMsg("<script>", lib.render(lib.text("