Closed qmfrederik closed 7 years ago
May be related to #19
@qmfrederik can you add the tests from https://github.com/3breadt/dd-plist? I'm currently unable to use my VS2017 env and MonoDevelop has not yet been updated for the new csproj. I can write the tests manually but can't test'em 😢
@claunia Sure, I'll take a stab at porting the tests.
re: .NET core, which OS are you on? On Mac, Visual Studio for Mac works pretty well, on Linux & Mac Visual Studio Code can also help :)
@qmfrederik usually I'm on a huge Linux with VMs for Mac and Windows 10. Right now I'm restricted to bed with a Mac laptop. I'll check VS:Mac then (let's hope nunit works there, it doesn't on VS2017).
Yeah, at the moment NUnit doesn't fully support .NET Core yet, the only option which works is NUnitLite.
xUnit does work. It's pretty much a drop-in replacement. Let me see if I can get things to work with xUnit.
@claunia I've had a look at the test in dd-plist and I'm moving the new tests over to plist-cil.
That said, I didn't see any tests related to binary file handling. Did you have a specific test in mind?
@qmfrederik https://github.com/3breadt/dd-plist/commit/a5fb37384d4ca7a3b5039a7605ca0e9ca926a6ec seems he did not create a unit test for this particular issue. Please feel free to create one.
We use plist-cil to implement one of Apple's protocols, and we strive to get binary compatibility. That is, we generate the exact same value on disk as the macOS tools do.
We've noticed that plist-cil tries to re-use object IDs in a property list: if you add the same object twice, the
BinaryPropertyListWriter
will add it once to the property list file and re-use the same ID.Unfortunately, we hit a scenario where we need to write same value twice to the file, with different IDs.
This PR implements that. Because it would be a pitty to loose the optimization, we've added a
ReuseObjectIds
property which can be used to control this behavior.