- commit
- 8261bb80c83c244657e302fa147cd9757ee1f773
- parent
- 9c1513c6a0386b403306696184583642260055e3
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2022-12-09 09:37
tweak tests
Diffstat
M | static/test.js | 6 | +++--- |
1 files changed, 3 insertions, 3 deletions
diff --git a/static/test.js b/static/test.js
@@ -11,7 +11,7 @@ var assertEqual = function(a, b, msg) { 11 11 var testChange = function(a, b) { 12 12 var change = diff.diff(a, b, 3); 13 13 var actual = diff.apply(a, change);14 -1 assertEqual(actual, b, 'testChange:' + a);-1 14 assertEqual(actual, b, `testChange: "${a}" -> "${b}"`); 15 15 }; 16 16 17 17 testChange('', 'asd'); @@ -20,8 +20,8 @@ testChange('foobaz', 'foobarbaz'); 20 20 testChange('barbaz', 'foobarbaz'); 21 21 testChange('asd', 'as'); 22 2223 -1 assertEqual(diff.diff('xxasdz', 'xxasz', 0), [4, 1, 'd', '']);24 -1 assertEqual(diff.diff('xxasdz', 'xxasz', 3), [1, 0, 'xasdz', 'xasz']);-1 23 assertEqual(diff.diff('xxasdz', 'xxasz', 0), [4, 1, 'd', ''], 'diff insert'); -1 24 assertEqual(diff.diff('xxasdz', 'xxasz', 3), [1, 0, 'xasdz', 'xasz'], 'diff delete'); 25 25 26 26 assertEqual(diff.merge([1, 0, 'foobaz', 'foobbaz'], [2, 1, 'oobba', 'oobaba']), [[1, 0, 'foobaz', 'foobabaz']], 'merge insert'); 27 27 assertEqual(diff.merge([1, 1, 'fooba', 'foba'], [0, 0, 'Xfobaz', 'Xfbaz']), [[0, 0, 'Xfoobaz', 'Xfbaz']], 'merge delete');