@@ -7,7 +7,7 @@ var decode = dop.decode;
77
88
99
10- function applyPatch ( collector ) {
10+ function getPatch ( collector ) {
1111 var patch = dop . core . getPatch ( collector . mutations ) ;
1212 var patchServer = decode ( encode ( patch ) ) ;
1313 collector . destroy ( ) ;
@@ -36,7 +36,7 @@ test(header+'Adding property', function(t) {
3636
3737 var collector = dop . collect ( ) ;
3838 set ( objectServer , 'one' , 1 ) ;
39- var patchGenerated = applyPatch ( collector ) ;
39+ var patchGenerated = getPatch ( collector ) ;
4040 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
4141 maketest ( t , patchGenerated , patchExpected ) ;
4242} ) ;
@@ -49,7 +49,7 @@ test(header+'Changing property', function(t) {
4949
5050 var collector = dop . collect ( ) ;
5151 set ( objectServer , 'one' , 11 ) ;
52- var patchGenerated = applyPatch ( collector ) ;
52+ var patchGenerated = getPatch ( collector ) ;
5353 t . equal ( collector . mutations . length , 1 , 'Mutations expecteds: ' + collector . mutations . length ) ;
5454 maketest ( t , patchGenerated , patchExpected ) ;
5555} ) ;
@@ -62,7 +62,7 @@ test(header+'Changing property with the same value', function(t) {
6262
6363 var collector = dop . collect ( ) ;
6464 set ( objectServer , 'one' , 11 ) ;
65- var patchGenerated = applyPatch ( collector ) ;
65+ var patchGenerated = getPatch ( collector ) ;
6666 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
6767 maketest ( t , patchGenerated , patchExpected ) ;
6868} ) ;
@@ -75,7 +75,7 @@ test(header+'Deleting property', function(t) {
7575
7676 var collector = dop . collect ( ) ;
7777 del ( objectServer , 'one' ) ;
78- var patchGenerated = applyPatch ( collector ) ;
78+ var patchGenerated = getPatch ( collector ) ;
7979 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
8080 maketest ( t , patchGenerated , patchExpected ) ;
8181} ) ;
@@ -89,7 +89,7 @@ test(header+'Change and delete a removed item', function(t) {
8989 set ( objectServer , 'one' , 'Changeddd' ) ;
9090 del ( objectServer , 'one' ) ;
9191 set ( objectServer , 'two' , 2 ) ;
92- var patchGenerated = applyPatch ( collector ) ;
92+ var patchGenerated = getPatch ( collector ) ;
9393 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
9494 maketest ( t , patchGenerated , patchExpected ) ;
9595} ) ;
@@ -105,7 +105,7 @@ test(header+'Setting property array', function(t) {
105105 set ( object . array , 5 , "three" ) ;
106106
107107
108- var patchGenerated = applyPatch ( collector ) ;
108+ var patchGenerated = getPatch ( collector ) ;
109109 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
110110 maketest ( t , patchGenerated , patchExpected ) ;
111111} ) ;
@@ -134,7 +134,7 @@ test(header+'Setting an array and mutating it', function(t) {
134134 set ( object . array [ 2 ] , 'B1' , 'string' ) ;
135135
136136
137- var patchGenerated = applyPatch ( collector ) ;
137+ var patchGenerated = getPatch ( collector ) ;
138138 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
139139 maketest ( t , patchGenerated , patchExpected ) ;
140140} ) ;
@@ -156,7 +156,7 @@ test(header+'Mutating array then mutating nested objects', function(t) {
156156
157157
158158
159- var patchGenerated = applyPatch ( collector ) ;
159+ var patchGenerated = getPatch ( collector ) ;
160160 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
161161 maketest ( t , patchGenerated , patchExpected ) ;
162162} ) ;
@@ -177,7 +177,7 @@ test(header+'Mutating nested objects then mutating parent array', function(t) {
177177
178178
179179
180- var patchGenerated = applyPatch ( collector ) ;
180+ var patchGenerated = getPatch ( collector ) ;
181181 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
182182 maketest ( t , patchGenerated , patchExpected ) ;
183183} ) ;
@@ -197,7 +197,7 @@ test(header+'Mutating array twice', function(t) {
197197 object . array . sort ( ) ;
198198
199199
200- var patchGenerated = applyPatch ( collector ) ;
200+ var patchGenerated = getPatch ( collector ) ;
201201 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
202202 maketest ( t , patchGenerated , patchExpected ) ;
203203
@@ -217,7 +217,7 @@ test(header+'Mutating array and mutating array deeper', function(t) {
217217 object . array [ 0 ] . reverse ( ) ;
218218
219219
220- var patchGenerated = applyPatch ( collector ) ;
220+ var patchGenerated = getPatch ( collector ) ;
221221 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
222222 maketest ( t , patchGenerated , patchExpected ) ;
223223
@@ -236,7 +236,7 @@ test(header+'Mutating array deeper and mutating container', function(t) {
236236 object . array . reverse ( ) ;
237237
238238
239- var patchGenerated = applyPatch ( collector ) ;
239+ var patchGenerated = getPatch ( collector ) ;
240240 t . equal ( collector . mutations . length , mutationsExpected , 'Mutations expecteds: ' + collector . mutations . length ) ;
241241 maketest ( t , patchGenerated , patchExpected ) ;
242242} )
0 commit comments