@@ -92,6 +92,40 @@ describe('easysync-assembler', function () {
92
92
expect ( assem . toString ( ) ) . to . equal ( '-k' ) ;
93
93
} ) ;
94
94
95
+ it ( 'smartOpAssembler append - op with text' , async function ( ) {
96
+ const assem = Changeset . smartOpAssembler ( ) ;
97
+ const pool = poolOrArray ( [
98
+ 'attr1,1' ,
99
+ 'attr2,2' ,
100
+ 'attr3,3' ,
101
+ 'attr4,4' ,
102
+ 'attr5,5' ,
103
+ ] ) ;
104
+
105
+ assem . appendOpWithText ( '-' , 'test' , '*3*4*5' , pool ) ;
106
+ assem . appendOpWithText ( '-' , 'test' , '*3*4*5' , pool ) ;
107
+ assem . appendOpWithText ( '-' , 'test' , '*1*4*5' , pool ) ;
108
+ assem . endDocument ( ) ;
109
+ expect ( assem . toString ( ) ) . to . equal ( '*3*4*5-8*1*4*5-4' ) ;
110
+ } ) ;
111
+
112
+ it ( 'smartOpAssembler append - op with multiline text' , async function ( ) {
113
+ const assem = Changeset . smartOpAssembler ( ) ;
114
+ const pool = poolOrArray ( [
115
+ 'attr1,1' ,
116
+ 'attr2,2' ,
117
+ 'attr3,3' ,
118
+ 'attr4,4' ,
119
+ 'attr5,5' ,
120
+ ] ) ;
121
+
122
+ assem . appendOpWithText ( '-' , 'test\ntest' , '*3*4*5' , pool ) ;
123
+ assem . appendOpWithText ( '-' , '\ntest\n' , '*3*4*5' , pool ) ;
124
+ assem . appendOpWithText ( '-' , '\ntest' , '*1*4*5' , pool ) ;
125
+ assem . endDocument ( ) ;
126
+ expect ( assem . toString ( ) ) . to . equal ( '*3*4*5|3-f*1*4*5|1-1*1*4*5-4' ) ;
127
+ } ) ;
128
+
95
129
it ( 'smartOpAssembler append + op with text' , async function ( ) {
96
130
const assem = Changeset . smartOpAssembler ( ) ;
97
131
const pool = poolOrArray ( [
0 commit comments