michael@0: function zero(...rest) michael@0: { michael@0: assertEq(rest.length, 0, "zero rest wrong length"); michael@0: } michael@0: michael@0: function tzero() michael@0: { michael@0: zero(); michael@0: } michael@0: michael@0: tzero(); tzero(); tzero(); michael@0: michael@0: function one(...rest) michael@0: { michael@0: assertEq(rest.length, 1, "one rest wrong length"); michael@0: } michael@0: michael@0: function tone() michael@0: { michael@0: one(0); michael@0: } michael@0: michael@0: tone(); tone(); tone(); michael@0: michael@0: function two(...rest) michael@0: { michael@0: assertEq(rest.length, 2, "two rest wrong length"); michael@0: } michael@0: michael@0: function ttwo() michael@0: { michael@0: two(0, 1); michael@0: } michael@0: michael@0: ttwo(); ttwo(); ttwo(); michael@0: michael@0: function zeroWithLeading0(x, ...rest) michael@0: { michael@0: assertEq(rest.length, 0, "zeroWithLeading0 rest wrong length"); michael@0: } michael@0: michael@0: function tzeroWithLeading0() michael@0: { michael@0: zeroWithLeading0(); michael@0: } michael@0: michael@0: tzeroWithLeading0(); tzeroWithLeading0(); tzeroWithLeading0(); michael@0: michael@0: function zeroWithLeading1(x, ...rest) michael@0: { michael@0: assertEq(rest.length, 0, "zeroWithLeading1 rest wrong length"); michael@0: } michael@0: michael@0: function tzeroWithLeading1() michael@0: { michael@0: zeroWithLeading1(0); michael@0: } michael@0: michael@0: tzeroWithLeading1(); tzeroWithLeading1(); tzeroWithLeading1(); michael@0: michael@0: function oneWithLeading(x, ...rest) michael@0: { michael@0: assertEq(rest.length, 1, "oneWithLeading rest wrong length"); michael@0: } michael@0: michael@0: function toneWithLeading() michael@0: { michael@0: oneWithLeading(0, 1); michael@0: } michael@0: michael@0: toneWithLeading(); toneWithLeading(); toneWithLeading(); michael@0: michael@0: function twoWithLeading(x, ...rest) michael@0: { michael@0: assertEq(rest.length, 2, "twoWithLeading rest wrong length"); michael@0: } michael@0: michael@0: function ttwoWithLeading() michael@0: { michael@0: twoWithLeading(0, 1, 2); michael@0: } michael@0: michael@0: ttwoWithLeading(); ttwoWithLeading(); ttwoWithLeading();