16 lines
438 B
D
16 lines
438 B
D
import std.stdio;
|
|
import xdiff_mmfile : MMFile;
|
|
|
|
void main()
|
|
{
|
|
auto a = MMFile.fromBytes(cast(ubyte[])"hello world\n");
|
|
auto b = MMFile.fromBytes(cast(ubyte[])"hello world!\n");
|
|
|
|
auto patch = a.computePatch(b);
|
|
writeln("patch size: ", patch.size());
|
|
|
|
auto res = a.applyPatch(patch);
|
|
writeln("apply success: ", res.success);
|
|
write(res.patched.asSlice()); // печатаем результат
|
|
writeln();
|
|
}
|