tdecode_helpers.nim 484 B

12345678910111213141516171819202122232425262728
  1. import std/private/decode_helpers
  2. import std/assertions
  3. block:
  4. var i = 0
  5. let c = decodePercent("%t9", i)
  6. doAssert (i, c) == (0, '%')
  7. block:
  8. var i = 0
  9. let c = decodePercent("19", i)
  10. doAssert (i, c) == (0, '%')
  11. block:
  12. var i = 0
  13. let c = decodePercent("%19", i)
  14. doAssert (i, c) == (2, '\x19')
  15. block:
  16. var i = 0
  17. let c = decodePercent("%A9", i)
  18. doAssert (i, c) == (2, '\xA9')
  19. block:
  20. var i = 0
  21. let c = decodePercent("%Aa", i)
  22. doAssert (i, c) == (2, '\xAA')