mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-28 02:20:10 +00:00
tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2b6442088c
commit
c5601945c4
3
diff.js
3
diff.js
@ -328,8 +328,7 @@ var LogicTypePrototype = {
|
||||
if(arguments.length < 3 || !(cmp instanceof Function)){
|
||||
return Diff.cmp(
|
||||
cmp instanceof Function ? this : this.context(cmp),
|
||||
obj)
|
||||
}
|
||||
obj) }
|
||||
|
||||
/*
|
||||
cmp = cmp || function(a, b){
|
||||
|
||||
25
test.js
25
test.js
@ -69,11 +69,32 @@ test.Tests({
|
||||
test.Cases({
|
||||
'basics': function(assert){
|
||||
// XXX move reference objects + expected diffs to setups
|
||||
a = {}
|
||||
b = {}
|
||||
var a = {}
|
||||
var b = {}
|
||||
|
||||
assert(diff.Diff(a, b), 'Diff(..)')
|
||||
},
|
||||
recursion: function(assert){
|
||||
var a = {}
|
||||
a.x = a
|
||||
var b = {}
|
||||
b.x = b
|
||||
|
||||
assert(diff.cmp(a, b), 'recursive cmp(..)')
|
||||
|
||||
a = {}
|
||||
a.x = a
|
||||
b = {}
|
||||
b.y = b
|
||||
assert(!diff.cmp(a, b), 'recursive !cmp(..)')
|
||||
|
||||
|
||||
a = {}
|
||||
a.x = a
|
||||
b = {x: {}}
|
||||
|
||||
assert(!diff.cmp(a, b), 'recursive cmp(..)')
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user