ai_old/goja/builtin_global_test.go
2024-09-20 16:50:35 +08:00

22 lines
407 B
Go

package goja
import (
"testing"
)
func TestEncodeURI(t *testing.T) {
const SCRIPT = `
encodeURI('тест')
`
testScript(SCRIPT, asciiString("%D1%82%D0%B5%D1%81%D1%82"), t)
}
func TestDecodeURI(t *testing.T) {
const SCRIPT = `
decodeURI("http://ru.wikipedia.org/wiki/%d0%ae%D0%bd%D0%B8%D0%BA%D0%BE%D0%B4")
`
testScript(SCRIPT, newStringValue("http://ru.wikipedia.org/wiki/Юникод"), t)
}