8
8
9
9
/* eslint-disable @typescript-eslint/no-explicit-any */
10
10
import { path } from '../path' ;
11
- import { fileBuffer } from './buffer' ;
11
+ import { stringToFileBuffer } from './buffer' ;
12
12
import { CordHost } from './record' ;
13
13
import { test } from './test' ;
14
14
@@ -22,7 +22,7 @@ describe('CordHost', () => {
22
22
} ) ;
23
23
24
24
const host = new CordHost ( base ) ;
25
- host . write ( path `/blue` , fileBuffer `hi` ) . subscribe ( undefined , done . fail ) ;
25
+ host . write ( path `/blue` , stringToFileBuffer ( `hi` ) ) . subscribe ( undefined , done . fail ) ;
26
26
27
27
const target = new TestHost ( ) ;
28
28
host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -42,8 +42,8 @@ describe('CordHost', () => {
42
42
} ) ;
43
43
44
44
const host = new CordHost ( base ) ;
45
- host . write ( path `/blue` , fileBuffer `hi` ) . subscribe ( undefined , done . fail ) ;
46
- host . write ( path `/blue` , fileBuffer `hi again` ) . subscribe ( undefined , done . fail ) ;
45
+ host . write ( path `/blue` , stringToFileBuffer ( `hi` ) ) . subscribe ( undefined , done . fail ) ;
46
+ host . write ( path `/blue` , stringToFileBuffer ( `hi again` ) ) . subscribe ( undefined , done . fail ) ;
47
47
48
48
const target = new TestHost ( ) ;
49
49
host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -64,7 +64,7 @@ describe('CordHost', () => {
64
64
} ) ;
65
65
66
66
const host = new CordHost ( base ) ;
67
- host . write ( path `/blue` , fileBuffer `hi` ) . subscribe ( undefined , done . fail ) ;
67
+ host . write ( path `/blue` , stringToFileBuffer ( `hi` ) ) . subscribe ( undefined , done . fail ) ;
68
68
host . delete ( path `/blue` ) . subscribe ( undefined , done . fail ) ;
69
69
70
70
const target = new TestHost ( ) ;
@@ -83,7 +83,7 @@ describe('CordHost', () => {
83
83
} ) ;
84
84
85
85
const host = new CordHost ( base ) ;
86
- host . write ( path `/blue` , fileBuffer `hi` ) . subscribe ( undefined , done . fail ) ;
86
+ host . write ( path `/blue` , stringToFileBuffer ( `hi` ) ) . subscribe ( undefined , done . fail ) ;
87
87
host . rename ( path `/blue` , path `/red` ) . subscribe ( undefined , done . fail ) ;
88
88
89
89
const target = new TestHost ( ) ;
@@ -107,7 +107,7 @@ describe('CordHost', () => {
107
107
} ) ;
108
108
109
109
const host = new CordHost ( base ) ;
110
- host . write ( path `/blue` , fileBuffer `hi` ) . subscribe ( undefined , done . fail ) ;
110
+ host . write ( path `/blue` , stringToFileBuffer ( `hi` ) ) . subscribe ( undefined , done . fail ) ;
111
111
host . rename ( path `/blue` , path `/blue` ) . subscribe ( undefined , done . fail ) ;
112
112
113
113
const target = new TestHost ( ) ;
@@ -130,7 +130,7 @@ describe('CordHost', () => {
130
130
} ) ;
131
131
132
132
const host = new CordHost ( base ) ;
133
- host . write ( path `/blue` , fileBuffer `hi` ) . subscribe ( undefined , done . fail ) ;
133
+ host . write ( path `/blue` , stringToFileBuffer ( `hi` ) ) . subscribe ( undefined , done . fail ) ;
134
134
host . rename ( path `/blue` , path `/red` ) . subscribe ( undefined , done . fail ) ;
135
135
host . rename ( path `/red` , path `/yellow` ) . subscribe ( undefined , done . fail ) ;
136
136
@@ -203,7 +203,7 @@ describe('CordHost', () => {
203
203
204
204
const host = new CordHost ( base ) ;
205
205
host . rename ( path `/hello` , path `/blue` ) . subscribe ( undefined , done . fail ) ;
206
- host . write ( path `/hello` , fileBuffer `beautiful world` ) . subscribe ( undefined , done . fail ) ;
206
+ host . write ( path `/hello` , stringToFileBuffer ( `beautiful world` ) ) . subscribe ( undefined , done . fail ) ;
207
207
208
208
const target = base . clone ( ) ;
209
209
host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -226,7 +226,7 @@ describe('CordHost', () => {
226
226
} ) ;
227
227
228
228
const host = new CordHost ( base ) ;
229
- host . write ( path `/hello` , fileBuffer `beautiful world` ) . subscribe ( undefined , done . fail ) ;
229
+ host . write ( path `/hello` , stringToFileBuffer ( `beautiful world` ) ) . subscribe ( undefined , done . fail ) ;
230
230
231
231
const target = base . clone ( ) ;
232
232
host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -248,8 +248,8 @@ describe('CordHost', () => {
248
248
} ) ;
249
249
250
250
const host = new CordHost ( base ) ;
251
- host . write ( path `/hello` , fileBuffer `beautiful world` ) . subscribe ( undefined , done . fail ) ;
252
- host . write ( path `/hello` , fileBuffer `again` ) . subscribe ( undefined , done . fail ) ;
251
+ host . write ( path `/hello` , stringToFileBuffer ( `beautiful world` ) ) . subscribe ( undefined , done . fail ) ;
252
+ host . write ( path `/hello` , stringToFileBuffer ( `again` ) ) . subscribe ( undefined , done . fail ) ;
253
253
254
254
const target = base . clone ( ) ;
255
255
host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -271,7 +271,7 @@ describe('CordHost', () => {
271
271
} ) ;
272
272
273
273
const host = new CordHost ( base ) ;
274
- host . write ( path `/hello` , fileBuffer `beautiful world` ) . subscribe ( undefined , done . fail ) ;
274
+ host . write ( path `/hello` , stringToFileBuffer ( `beautiful world` ) ) . subscribe ( undefined , done . fail ) ;
275
275
host . rename ( path `/hello` , path `/blue` ) . subscribe ( undefined , done . fail ) ;
276
276
277
277
const target = base . clone ( ) ;
@@ -295,7 +295,7 @@ describe('CordHost', () => {
295
295
} ) ;
296
296
297
297
const host = new CordHost ( base ) ;
298
- host . write ( path `/hello` , fileBuffer `beautiful world` ) . subscribe ( undefined , done . fail ) ;
298
+ host . write ( path `/hello` , stringToFileBuffer ( `beautiful world` ) ) . subscribe ( undefined , done . fail ) ;
299
299
host . delete ( path `/hello` ) . subscribe ( undefined , done . fail ) ;
300
300
301
301
const target = base . clone ( ) ;
@@ -316,7 +316,7 @@ describe('CordHost', () => {
316
316
317
317
const host = new CordHost ( base ) ;
318
318
host . rename ( path `/hello` , path `/blue` ) . subscribe ( undefined , done . fail ) ;
319
- host . write ( path `/blue` , fileBuffer `beautiful world` ) . subscribe ( undefined , done . fail ) ;
319
+ host . write ( path `/blue` , stringToFileBuffer ( `beautiful world` ) ) . subscribe ( undefined , done . fail ) ;
320
320
321
321
const target = base . clone ( ) ;
322
322
host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -359,7 +359,7 @@ describe('CordHost', () => {
359
359
360
360
const host = new CordHost ( base ) ;
361
361
host . delete ( path `/hello` ) . subscribe ( undefined , done . fail ) ;
362
- host . write ( path `/hello` , fileBuffer `beautiful world` ) . subscribe ( undefined , done . fail ) ;
362
+ host . write ( path `/hello` , stringToFileBuffer ( `beautiful world` ) ) . subscribe ( undefined , done . fail ) ;
363
363
364
364
const target = base . clone ( ) ;
365
365
host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -421,7 +421,7 @@ describe('CordHost', () => {
421
421
} ) ;
422
422
423
423
const host = new CordHost ( base ) ;
424
- host . write ( path `/blue` , fileBuffer `hi` ) . subscribe ( ) ;
424
+ host . write ( path `/blue` , stringToFileBuffer ( `hi` ) ) . subscribe ( ) ;
425
425
426
426
const target = new TestHost ( {
427
427
'/blue' : 'test' ,
@@ -442,7 +442,7 @@ describe('CordHost', () => {
442
442
} ) ;
443
443
444
444
const host = new CordHost ( base ) ;
445
- host . write ( path `/hello` , fileBuffer `hi` ) . subscribe ( ) ;
445
+ host . write ( path `/hello` , stringToFileBuffer ( `hi` ) ) . subscribe ( ) ;
446
446
447
447
const target = new TestHost ( { } ) ;
448
448
@@ -502,7 +502,7 @@ describe('CordHost', () => {
502
502
503
503
const host = new CordHost ( base ) ;
504
504
let error = false ;
505
- host . write ( path `/dir` , fileBuffer `beautiful world` ) . subscribe (
505
+ host . write ( path `/dir` , stringToFileBuffer ( `beautiful world` ) ) . subscribe (
506
506
undefined ,
507
507
( ) => ( error = true ) ,
508
508
( ) => ( error = false ) ,
0 commit comments