Fix negative number handling for snbt parsers

This commit is contained in:
zontreck 2025-01-22 03:12:53 -07:00
parent 18e98ca918
commit 900a5358a8
7 changed files with 32 additions and 7 deletions

View file

@ -144,4 +144,12 @@ void main() {
CompoundTag CT =
await SnbtIo.readFromFile("test/displayLoreTest.snbt") as CompoundTag;
}, timeout: Timeout(Duration(minutes: 10)));
test("Test negative numbers from SNBT", () async {
String snbt = "{test: -932.0d}";
CompoundTag ct = await SnbtIo.readFromString(snbt) as CompoundTag;
expect(ct["test"]!.getTagType(), TagType.Double);
expect(ct["test"]!.asDouble(), -932.0);
});
}