3 # Copyright 2017 by Denys Vlasenko <vda.linux@googlemail.com>
4 # Licensed under GPLv2, see file LICENSE in this source tree.
8 # testing "test name" "command" "expected result" "file input" "stdin"
9 # file input will be file called "input"
10 # test can create a file "actual" instead of writing to stdout
12 testing "factor ' 0'" \
20 testing "factor ' +2'" \
25 testing "factor 1024" \
27 "1024: 2 2 2 2 2 2 2 2 2 2\n" \
30 testing "factor 2^61-1" \
31 "factor 2305843009213693951" \
32 "2305843009213693951: 2305843009213693951\n" \
34 testing "factor 2^62-1" \
35 "factor 4611686018427387903" \
36 "4611686018427387903: 3 715827883 2147483647\n" \
38 testing "factor 2^64-1" \
39 "factor 18446744073709551615" \
40 "18446744073709551615: 3 5 17 257 641 65537 6700417\n" \
42 # This is a 60-bit number (0x888 86ff db34 4692): first few primes multiplied together:
43 testing "factor \$((2*3*5*7*11*13*17*19*23*29*31*37*41*43*47))" \
44 "factor \$((2*3*5*7*11*13*17*19*23*29*31*37*41*43*47))" \
45 "614889782588491410: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47\n" \