Add NS.string as primitive

This commit is contained in:
Frederik Carlier
2018-06-26 17:09:33 +02:00
parent a035dd5056
commit 6a96ff142c
4 changed files with 20 additions and 0 deletions

View File

@@ -53,5 +53,21 @@ namespace plistcil.test
writer.Write(root);
}
}
[Fact]
public void Roundtrip4Test()
{
byte[] data = File.ReadAllBytes("test-files/plist4.bin");
NSObject root = PropertyListParser.Parse(data);
using (MemoryStream actualOutput = new MemoryStream())
using (Stream expectedOutput = File.OpenRead("test-files/plist4.bin"))
using (ValidatingStream validatingStream = new ValidatingStream(actualOutput, expectedOutput))
{
BinaryPropertyListWriter writer = new BinaryPropertyListWriter(validatingStream);
writer.ReuseObjectIds = false;
writer.Write(root);
}
}
}
}

View File

@@ -122,6 +122,9 @@
<None Update="test-files\plist3.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="test-files\plist4.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="test-files\RoundtripBinaryIndentation.plist">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

Binary file not shown.

View File

@@ -424,6 +424,7 @@ namespace Claunia.PropertyList
|| content == "NS.keys"
|| content == "NS.base"
|| content == "NS.relative"
|| content == "NS.string"
|| content == "NSURL"
|| content == "NSDictionary"
|| content == "NSObject"