import * as O from '.' ; describe ( 'chars' , ( ) => { it ( 'read' , ( ) => { const result = O . collect ( O . chars , 'foo' ) ; expect ( result ) . toEqual ( [ 'f' , 'o' , 'o' ] ) ; } ) ; it ( 'write' , ( ) => { const nextChar = ( c ) => String . fromCharCode ( c . charCodeAt ( 0 ) + 1 ) ; const result = O . modify ( O . chars , nextChar , 'foo' ) ; expect ( result ) . toEqual ( 'gpp' ) ; } ) ; it ( 'write longer' , ( ) => { const result = O . modify ( O . chars , ( s ) => s + s , 'abc' ) ; expect ( result ) . toEqual ( 'aabbcc' ) ; } ) ; it ( 'remove chars' , ( ) => { const result = O . modify ( O . chars , ( s ) => ( s === 'b' || s === 'f' ? '' : s ) , 'abcdef' ) ; expect ( result ) . toEqual ( 'acde' ) ; } ) ; } ) ;