🍯 Glaze

package http_tests

import "core:testing"

import "lib:net/http"

@(test)
escape_html_test :: proc(t: ^testing.T) {
	tests := [][2]string {
		{"test string", "test string"},
		{"test & string", "test & string"},
		{"test  string", "test <foo> string"},
		{"'test string", "'test string"},
		{"test string\"", "test string""},
	}

	for tst in tests {
		result, ok := http.escape_html(tst[0])
		testing.expect(t, tst[1] == result)
		if ok {
			delete(result)
		}
	}
}