2021-08-23 11:43:45 +08:00
|
|
|
using System;
|
|
|
|
using Xunit;
|
|
|
|
using Xunit.Abstractions;
|
|
|
|
using Xunit.Sdk;
|
|
|
|
|
|
|
|
namespace SharpNBT.Tests
|
|
|
|
{
|
|
|
|
public class PrettyPrint
|
|
|
|
{
|
|
|
|
private readonly ITestOutputHelper output;
|
|
|
|
|
|
|
|
public PrettyPrint(ITestOutputHelper output)
|
|
|
|
{
|
|
|
|
this.output = output;
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public void PrettyPrintToStdout()
|
|
|
|
{
|
2021-08-24 20:11:32 +08:00
|
|
|
using var stream = NbtFile.OpenRead("./Data/bigtest.nbt", FormatOptions.Java);
|
2021-08-23 11:43:45 +08:00
|
|
|
var topLevel = stream.ReadTag<CompoundTag>();
|
|
|
|
|
|
|
|
output.WriteLine(topLevel.PrettyPrinted());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|