1 # Test cases for token.c
2 # BEWARE: This file contains strange spacing (trailing spaces etc.), which is vital.
3 # Please edit carefully.
5 # A simple test case with several spaces
15 # The same test case in line mode
17 Run: bin/test-tok -l 2>&1
27 # An unterminated line
29 Run: tr -d '\n' | bin/test-tok 2>&1
33 # An unterminated line in line mode
35 Run: tr -d '\n' | bin/test-tok -l 2>&1
39 # Small token size limit, but fits
41 Run: bin/test-tok -s 2>&1
43 Out: <abcdefghijklmnop>
45 # Small token size limit, does not fit
47 Run: bin/test-tok -s 2>&1
53 Run: bin/test-tok -vl 2>&1
58 <0> = int 0 = uint 0 = long 0 = ulong 0 = double 0.000000 = long_double 0.000000
59 <5> = int 5 = uint 5 = long 5 = ulong 5 = double 5.000000 = long_double 5.000000
60 <-5> = int -5 = long -5 = double -5.000000 = long_double -5.000000
63 # More parsing: integer extremes
65 Run: bin/test-tok -v 2>&1
66 In: -2147483647 2147483647
67 -2147483648 2147483648
68 -4294967295 4294967295
69 -4294967296 4294967296
70 Out: <-2147483647> = int -2147483647 = long -2147483647 = double -2147483647.000000 = long_double -2147483647.000000
71 <2147483647> = int 2147483647 = uint 2147483647 = long 2147483647 = ulong 2147483647 = double 2147483647.000000 = long_double 2147483647.000000
72 <-2147483648> = int -2147483648 = long -2147483648 = double -2147483648.000000 = long_double -2147483648.000000
73 <2147483648> = uint 2147483648 = ulong 2147483648 = double 2147483648.000000 = long_double 2147483648.000000
74 <-4294967295> = double -4294967295.000000 = long_double -4294967295.000000
75 <4294967295> = uint 4294967295 = ulong 4294967295 = double 4294967295.000000 = long_double 4294967295.000000
76 <-4294967296> = double -4294967296.000000 = long_double -4294967296.000000
77 <4294967296> = double 4294967296.000000 = long_double 4294967296.000000
79 # More parsing: floating point numbers
87 Out: <1000000000> = int 1000000000 = uint 1000000000 = long 1000000000 = ulong 1000000000 = double 1000000000.000000 = long_double 1000000000.000000
88 <0.> = double 0.000000 = long_double 0.000000
89 <.0> = double 0.000000 = long_double 0.000000
91 <0> = int 0 = uint 0 = long 0 = ulong 0 = double 0.000000 = long_double 0.000000
92 <+0> = int 0 = uint 0 = long 0 = ulong 0 = double 0.000000 = long_double 0.000000
93 <-0> = int 0 = long 0 = double -0.000000 = long_double -0.000000
94 <+5> = int 5 = uint 5 = long 5 = ulong 5 = double 5.000000 = long_double 5.000000
95 <-5> = int -5 = long -5 = double -5.000000 = long_double -5.000000
96 <+1e+5> = double 100000.000000 = long_double 100000.000000
97 <-1e-5> = double -0.000010 = long_double -0.000010