88
99/* eslint-disable @typescript-eslint/no-explicit-any */
1010import { path } from '../path' ;
11- import { fileBuffer } from './buffer' ;
11+ import { stringToFileBuffer } from './buffer' ;
1212import { CordHost } from './record' ;
1313import { test } from './test' ;
1414
@@ -22,7 +22,7 @@ describe('CordHost', () => {
2222 } ) ;
2323
2424 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 ) ;
2626
2727 const target = new TestHost ( ) ;
2828 host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -42,8 +42,8 @@ describe('CordHost', () => {
4242 } ) ;
4343
4444 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 ) ;
4747
4848 const target = new TestHost ( ) ;
4949 host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -64,7 +64,7 @@ describe('CordHost', () => {
6464 } ) ;
6565
6666 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 ) ;
6868 host . delete ( path `/blue` ) . subscribe ( undefined , done . fail ) ;
6969
7070 const target = new TestHost ( ) ;
@@ -83,7 +83,7 @@ describe('CordHost', () => {
8383 } ) ;
8484
8585 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 ) ;
8787 host . rename ( path `/blue` , path `/red` ) . subscribe ( undefined , done . fail ) ;
8888
8989 const target = new TestHost ( ) ;
@@ -107,7 +107,7 @@ describe('CordHost', () => {
107107 } ) ;
108108
109109 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 ) ;
111111 host . rename ( path `/blue` , path `/blue` ) . subscribe ( undefined , done . fail ) ;
112112
113113 const target = new TestHost ( ) ;
@@ -130,7 +130,7 @@ describe('CordHost', () => {
130130 } ) ;
131131
132132 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 ) ;
134134 host . rename ( path `/blue` , path `/red` ) . subscribe ( undefined , done . fail ) ;
135135 host . rename ( path `/red` , path `/yellow` ) . subscribe ( undefined , done . fail ) ;
136136
@@ -203,7 +203,7 @@ describe('CordHost', () => {
203203
204204 const host = new CordHost ( base ) ;
205205 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 ) ;
207207
208208 const target = base . clone ( ) ;
209209 host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -226,7 +226,7 @@ describe('CordHost', () => {
226226 } ) ;
227227
228228 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 ) ;
230230
231231 const target = base . clone ( ) ;
232232 host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -248,8 +248,8 @@ describe('CordHost', () => {
248248 } ) ;
249249
250250 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 ) ;
253253
254254 const target = base . clone ( ) ;
255255 host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -271,7 +271,7 @@ describe('CordHost', () => {
271271 } ) ;
272272
273273 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 ) ;
275275 host . rename ( path `/hello` , path `/blue` ) . subscribe ( undefined , done . fail ) ;
276276
277277 const target = base . clone ( ) ;
@@ -295,7 +295,7 @@ describe('CordHost', () => {
295295 } ) ;
296296
297297 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 ) ;
299299 host . delete ( path `/hello` ) . subscribe ( undefined , done . fail ) ;
300300
301301 const target = base . clone ( ) ;
@@ -316,7 +316,7 @@ describe('CordHost', () => {
316316
317317 const host = new CordHost ( base ) ;
318318 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 ) ;
320320
321321 const target = base . clone ( ) ;
322322 host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -359,7 +359,7 @@ describe('CordHost', () => {
359359
360360 const host = new CordHost ( base ) ;
361361 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 ) ;
363363
364364 const target = base . clone ( ) ;
365365 host . commit ( target ) . subscribe ( undefined , done . fail ) ;
@@ -421,7 +421,7 @@ describe('CordHost', () => {
421421 } ) ;
422422
423423 const host = new CordHost ( base ) ;
424- host . write ( path `/blue` , fileBuffer `hi` ) . subscribe ( ) ;
424+ host . write ( path `/blue` , stringToFileBuffer ( `hi` ) ) . subscribe ( ) ;
425425
426426 const target = new TestHost ( {
427427 '/blue' : 'test' ,
@@ -442,7 +442,7 @@ describe('CordHost', () => {
442442 } ) ;
443443
444444 const host = new CordHost ( base ) ;
445- host . write ( path `/hello` , fileBuffer `hi` ) . subscribe ( ) ;
445+ host . write ( path `/hello` , stringToFileBuffer ( `hi` ) ) . subscribe ( ) ;
446446
447447 const target = new TestHost ( { } ) ;
448448
@@ -502,7 +502,7 @@ describe('CordHost', () => {
502502
503503 const host = new CordHost ( base ) ;
504504 let error = false ;
505- host . write ( path `/dir` , fileBuffer `beautiful world` ) . subscribe (
505+ host . write ( path `/dir` , stringToFileBuffer ( `beautiful world` ) ) . subscribe (
506506 undefined ,
507507 ( ) => ( error = true ) ,
508508 ( ) => ( error = false ) ,
0 commit comments