import { range , zip } from "./ArrayUtils" ; describe ( "range" , ( ) => { it ( "できる" , ( ) => { const result = range ( 4 , 10 ) ; expect ( result ) . toStrictEqual ( [ 4 , 5 , 6 , 7 , 8 , 9 ] ) ; } ) ; it ( "同値" , ( ) => { const result = range ( 11 , 11 ) ; expect ( result ) . toStrictEqual ( [ ] ) ; } ) ; it ( "to < fromな引数はダメ" , ( ) => { expect ( ( ) => { range ( 3 , 2 ) ; } ) . toThrow ( ) ; } ) ; } ) ; describe ( "zip" , ( ) => { it ( "できる" , ( ) => { const result = zip ( [ 3 , 2 , 1 , 0 ] , [ "三" , "二" , "一" , "" ] ) ; expect ( result ) . toStrictEqual ( [ [ 3 , "三" ] , [ 2 , "二" ] , [ 1 , "一" ] , [ 0 , "" ] , ] ) ; } ) ; it ( "lengthが異なる引数はダメ" , ( ) => { expect ( ( ) => { zip ( [ 2 , 1 , 0 ] , [ "三" , "二" , "一" , "" ] ) ; } ) . toThrow ( ) ; } ) ; } ) ;