tdecode_helpers.nim 463 B

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