builtin_global_test.go 407 B

123456789101112131415161718192021
  1. package goja
  2. import (
  3. "testing"
  4. )
  5. func TestEncodeURI(t *testing.T) {
  6. const SCRIPT = `
  7. encodeURI('тест')
  8. `
  9. testScript(SCRIPT, asciiString("%D1%82%D0%B5%D1%81%D1%82"), t)
  10. }
  11. func TestDecodeURI(t *testing.T) {
  12. const SCRIPT = `
  13. decodeURI("http://ru.wikipedia.org/wiki/%d0%ae%D0%bd%D0%B8%D0%BA%D0%BE%D0%B4")
  14. `
  15. testScript(SCRIPT, newStringValue("http://ru.wikipedia.org/wiki/Юникод"), t)
  16. }