@@ -395,6 +395,26 @@ test("Groups of", async () => {
395395 expect ( groups [ 2 ] ) . toEqual ( [ 7 , 8 ] ) ;
396396} ) ;
397397
398+ test ( "Groups of record" , async ( ) => {
399+ await interp . run ( `
400+ [
401+ ['a' 1]
402+ ['b' 2]
403+ ['c' 3]
404+ ['d' 4]
405+ ['e' 5]
406+ ['f' 6]
407+ ['g' 7]
408+ ['h' 8]
409+ ] REC 3 GROUPS-OF
410+ ` ) ;
411+ const groups = interp . stack_pop ( ) ;
412+ expect ( groups [ 0 ] ) . toEqual ( { a : 1 , b : 2 , c : 3 } ) ;
413+ expect ( groups [ 1 ] ) . toEqual ( { d : 4 , e : 5 , f : 6 } ) ;
414+ expect ( groups [ 2 ] ) . toEqual ( { g : 7 , h : 8 } ) ;
415+ } ) ;
416+
417+
398418test ( "Groups of using record" , async ( ) => {
399419 // Test grouping a record
400420 interp = new Interpreter ( ) ;
@@ -1666,6 +1686,18 @@ test("Parallel map", async () => {
16661686 expect ( interp . stack_pop ( ) ) . toEqual ( [ 1 , 4 , 9 , 16 , 25 ] ) ;
16671687} ) ;
16681688
1689+ test ( "Parallel map over record" , async ( ) => {
1690+ await interp . run ( `
1691+ [
1692+ ['a' 1]
1693+ ['b' 2]
1694+ ['c' 3]
1695+ ['d' 4]
1696+ ] REC "3 *" 2 !INTERPS MAP
1697+ ` ) ;
1698+ expect ( interp . stack_pop ( ) ) . toEqual ( { a : 3 , b : 6 , c : 9 , d : 12 } ) ;
1699+ } ) ;
1700+
16691701test ( "|REC@|" , async ( ) => {
16701702 interp . stack_push ( [ { a : 1 } , { a : 2 } , { a : 3 } ] ) ;
16711703 await interp . run ( `'a' |REC@` ) ;
@@ -1828,3 +1860,9 @@ test("ADD-DAYS", async () => {
18281860 const res1 = interp . stack_pop ( ) ;
18291861 console . log ( "ADD-DAYS" , res1 ) ;
18301862} ) ;
1863+
1864+ test ( ".s" , async ( ) => {
1865+ await interp . run ( "1 2 .s 3 4" ) ;
1866+ const res1 = interp . stack_pop ( ) ;
1867+ expect ( res1 ) . toEqual ( 2 ) ;
1868+ } )
0 commit comments