Skip to content

Commit b0303b3

Browse files
committed
test: simplify numeric literal cfail tests
1 parent 3c7f619 commit b0303b3

File tree

2 files changed

+14
-53
lines changed

2 files changed

+14
-53
lines changed

src/test/compile-fail/lex-bad-numeric-literals.rs

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,18 @@ fn main() {
1818
0o7.0e7f64; //~ ERROR: octal float literal is not supported
1919
0x8.0e+9; //~ ERROR: hexadecimal float literal is not supported
2020
0x9.0e-9; //~ ERROR: hexadecimal float literal is not supported
21+
0o; //~ ERROR: no valid digits
22+
1e+; //~ ERROR: expected at least one digit in exponent
23+
0x539.0; //~ ERROR: hexadecimal float literal is not supported
24+
99999999999999999999999999999999; //~ ERROR: int literal is too large
25+
99999999999999999999999999999999u32; //~ ERROR: int literal is too large
26+
0x; //~ ERROR: no valid digits
27+
0xu32; //~ ERROR: no valid digits
28+
0ou32; //~ ERROR: no valid digits
29+
0bu32; //~ ERROR: no valid digits
30+
0b; //~ ERROR: no valid digits
31+
0o123f64; //~ ERROR: octal float literal is not supported
32+
0o123.456; //~ ERROR: octal float literal is not supported
33+
0b101f64; //~ ERROR: binary float literal is not supported
34+
0b111.101; //~ ERROR: binary float literal is not supported
2135
}
22-
23-
static F: f32 =
24-
1e+ //~ ERROR: scan_exponent: bad fp literal
25-
;
26-
27-
28-
static F: f32 =
29-
0x539.0 //~ ERROR: hexadecimal float literal is not supported
30-
;
31-
32-
static I: int =
33-
99999999999999999999999999999999 //~ ERROR: int literal is too large
34-
;
35-
36-
static J: int =
37-
99999999999999999999999999999999u32 //~ ERROR: int literal is too large
38-
;
39-
40-
static A: int =
41-
0x //~ ERROR: no valid digits
42-
;
43-
static B: int =
44-
0xu32 //~ ERROR: no valid digits
45-
;
46-
static C: int =
47-
0ou32 //~ ERROR: no valid digits
48-
;
49-
static D: int =
50-
0bu32 //~ ERROR: no valid digits
51-
;
52-
static E: int =
53-
0b //~ ERROR: no valid digits
54-
;
55-
static F: int =
56-
0o //~ ERROR: no valid digits
57-
;

src/test/compile-fail/no-oct-float-literal.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)