LibAC-dart/test/nbt_test.dart

17 lines
557 B
Dart

import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import 'package:libac_flutter/nbt/NbtIo.dart';
import 'package:libac_flutter/nbt/impl/CompoundTag.dart';
void main() {
test('read non-compressed helloworld NBT', () async {
print("READING : ${Directory.current.path}/test/hello_world.nbt");
CompoundTag tag =
await NbtIo.read("${Directory.current.path}/test/hello_world.nbt");
expect(tag.getKey(), "hello world");
expect(tag.contains("name"), true);
expect(tag.get("name")!.asString(), "Bananrama");
});
}