NBT
NBT copied to clipboard
Write unit tests
incomplete list of things that should be tested:
- CompoundTag/ListTag API
- [x] iterating in foreach
- [ ] getValue()
- [ ] getters and setters
- [ ] array-access API (yuck)
- [ ] count()ing tags (even things as simple as that can be botched, see https://github.com/pmmp/PocketMine-NBT/commit/da884fe4a70613f42c69c884bf8f30e9a272b04f)
- [x]
tag[] = valuesyntax should not be allowed (CompoundTags are effectively maps)
- ListTag-only API
- [ ] push(), pop(), etc (once #33 is done)
- [x] automatic detection of tag type when list is of type TAG_End
- [x] assigning wrong tag type to list that is not of type TAG_End (should throw exception)
- [x] setting tag type manually (should only be allowed when list is empty)
- [x] appending tags using
list[] = tagsyntax - [x] type checking for adding new tags to lists
- [x]
list[] = primitiveValueshould throw exceptions
- General NamedTag API
- [x] bounds checking for byte/short/int/long
- [ ] setName()/getName()
- [ ] creating tags with and without preset values
This does not currently cover any of the streams API (TODO).
There are currently no unit tests which test serialize API, which is a problem because this is quite a mission critical component