Skip to content

Commit

Permalink
Added string tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlegiantJGC committed Feb 20, 2024
1 parent 654b16a commit 662b545
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_amulet_nbt/test_tag/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ def test_to_nbt(self):
),
)

# Test writing long strings
self.assertEqual(
b"\x08\x00\x00\xff\xff" + b"a"*65535,
StringTag("a"*65535).to_nbt(compressed=False)
)

with self.assertRaises(OverflowError):
StringTag("a" * 65536).to_nbt(compressed=False)

def test_from_nbt(self):
self.assertEqual(
StringTag(),
Expand Down

0 comments on commit 662b545

Please sign in to comment.