test_string.py 296 B

123456789101112
  1. from erlpack import pack
  2. def test_string():
  3. atm = 'hello world'
  4. assert pack(atm) == '\x83m\x00\x00\x00\x0bhello world'
  5. def test_string_null_byte():
  6. null_byte = 'hello\x00 world'
  7. print "null_byte", null_byte
  8. assert pack(null_byte) == '\x83m\x00\x00\x00\x0chello\x00 world'