move ui tests into dedicated directories

This commit is contained in:
KodrAus 2021-11-02 07:26:49 +10:00
parent 2925da3372
commit 4d05425f98
9 changed files with 31 additions and 64 deletions

View File

@ -1,29 +0,0 @@
{{crate}}
---------
[![Latest Version](https://img.shields.io/crates/v/uuid.svg)](https://crates.io/crates/uuid)
[![Join the chat at https://gitter.im/uuid-rs/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/uuid-rs/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.34.0+-yellow.svg)
{{badges}}
---
{{readme}}
[`Uuid`]: https://docs.rs/uuid/{{version}}/uuid/struct.Uuid.html
---
# License
Licensed under either of
* Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
* MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.

View File

@ -48,12 +48,3 @@ fn parse_invalid_group_len(b: &mut Bencher) {
fn parse_invalid_groups(b: &mut Bencher) { fn parse_invalid_groups(b: &mut Bencher) {
b.iter(|| Uuid::parse_str("F9168C5E-CEB2-4faa-B6BFF329BF39FA1E4")); b.iter(|| Uuid::parse_str("F9168C5E-CEB2-4faa-B6BFF329BF39FA1E4"));
} }
#[cfg(feature = "macros")]
#[test]
fn test_valid_macro() {
let t = trybuild::TestCases::new();
t.pass("benches/macros/valid_parse.rs");
t.pass("benches/macros/renamed.rs");
t.compile_fail("benches/macros/invalid_parse.rs");
}

View File

@ -1,3 +0,0 @@
status = [
"continuous-integration/travis-ci/push",
]

7
tests/macros.rs Normal file
View File

@ -0,0 +1,7 @@
#[cfg(feature = "macros")]
#[test]
fn ui() {
let t = trybuild::TestCases::new();
t.pass("tests/ui/compile_pass/*.rs");
t.compile_fail("tests/ui/compile_fail/*.rs");
}

View File

@ -0,0 +1 @@
error: couldn't read $DIR/tests/ui/compile_fail: Is a directory (os error 21)

View File

@ -26,4 +26,4 @@ const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BGBF-329BF39FA1E4");
const _: Uuid = uuid!("01020304-1112-2122-3132-41424344"); const _: Uuid = uuid!("01020304-1112-2122-3132-41424344");
const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BFF329BF39FA1E4"); const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BFF329BF39FA1E4");
fn main() {} fn main() {}

View File

@ -1,125 +1,125 @@
error: invalid length: expected one of [36, 32], found 0 error: invalid length: expected one of [36, 32], found 0
--> benches/macros/invalid_parse.rs:3:23 --> tests/ui/compile_fail/invalid_parse.rs:3:23
| |
3 | const _: Uuid = uuid!(""); 3 | const _: Uuid = uuid!("");
| ^^ | ^^
error: invalid length: expected one of [36, 32], found 1 error: invalid length: expected one of [36, 32], found 1
--> benches/macros/invalid_parse.rs:4:23 --> tests/ui/compile_fail/invalid_parse.rs:4:23
| |
4 | const _: Uuid = uuid!("!"); 4 | const _: Uuid = uuid!("!");
| ^^^ | ^^^
error: invalid length: expected one of [36, 32], found 37 error: invalid length: expected one of [36, 32], found 37
--> benches/macros/invalid_parse.rs:5:23 --> tests/ui/compile_fail/invalid_parse.rs:5:23
| |
5 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E45"); 5 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E45");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid length: expected one of [36, 32], found 35 error: invalid length: expected one of [36, 32], found 35
--> benches/macros/invalid_parse.rs:6:23 --> tests/ui/compile_fail/invalid_parse.rs:6:23
| |
6 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BBF-329BF39FA1E4"); 6 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BBF-329BF39FA1E4");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found G at 20 error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found G at 20
--> benches/macros/invalid_parse.rs:7:44 --> tests/ui/compile_fail/invalid_parse.rs:7:44
| |
7 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BGBF-329BF39FA1E4"); 7 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BGBF-329BF39FA1E4");
| ^ | ^
error: invalid number of groups: expected one of [1, 5], found 4 error: invalid number of groups: expected one of [1, 5], found 4
--> benches/macros/invalid_parse.rs:8:23 --> tests/ui/compile_fail/invalid_parse.rs:8:23
| |
8 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BFF329BF39FA1E4"); 8 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BFF329BF39FA1E4");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid length: expected one of [36, 32], found 18 error: invalid length: expected one of [36, 32], found 18
--> benches/macros/invalid_parse.rs:9:23 --> tests/ui/compile_fail/invalid_parse.rs:9:23
| |
9 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa"); 9 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa");
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found X at 18 error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found X at 18
--> benches/macros/invalid_parse.rs:10:42 --> tests/ui/compile_fail/invalid_parse.rs:10:42
| |
10 | const _: Uuid = uuid!("F9168C5E-CEB2-4faaXB6BFF329BF39FA1E4"); 10 | const _: Uuid = uuid!("F9168C5E-CEB2-4faaXB6BFF329BF39FA1E4");
| ^ | ^
error: invalid group length: expected 4, found 3 in group 1 error: invalid group length: expected 4, found 3 in group 1
--> benches/macros/invalid_parse.rs:11:33 --> tests/ui/compile_fail/invalid_parse.rs:11:33
| |
11 | const _: Uuid = uuid!("F9168C5E-CEB-24fa-eB6BFF32-BF39FA1E4"); 11 | const _: Uuid = uuid!("F9168C5E-CEB-24fa-eB6BFF32-BF39FA1E4");
| ^^^ | ^^^
error: invalid group length: expected 12, found 8 in group 4 error: invalid group length: expected 12, found 8 in group 4
--> benches/macros/invalid_parse.rs:12:48 --> tests/ui/compile_fail/invalid_parse.rs:12:48
| |
12 | const _: Uuid = uuid!("01020304-1112-2122-3132-41424344"); 12 | const _: Uuid = uuid!("01020304-1112-2122-3132-41424344");
| ^^^^^^^^ | ^^^^^^^^
error: invalid length: expected one of [36, 32], found 33 error: invalid length: expected one of [36, 32], found 33
--> benches/macros/invalid_parse.rs:13:23 --> tests/ui/compile_fail/invalid_parse.rs:13:23
| |
13 | const _: Uuid = uuid!("67e5504410b1426f9247bb680e5fe0c88"); 13 | const _: Uuid = uuid!("67e5504410b1426f9247bb680e5fe0c88");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid length: expected one of [36, 32], found 33 error: invalid length: expected one of [36, 32], found 33
--> benches/macros/invalid_parse.rs:14:23 --> tests/ui/compile_fail/invalid_parse.rs:14:23
| |
14 | const _: Uuid = uuid!("67e5504410b1426f9247bb680e5fe0cg8"); 14 | const _: Uuid = uuid!("67e5504410b1426f9247bb680e5fe0cg8");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found % at 15 error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found % at 15
--> benches/macros/invalid_parse.rs:15:39 --> tests/ui/compile_fail/invalid_parse.rs:15:39
| |
15 | const _: Uuid = uuid!("67e5504410b1426%9247bb680e5fe0c8"); 15 | const _: Uuid = uuid!("67e5504410b1426%9247bb680e5fe0c8");
| ^ | ^
error: invalid length: expected one of [36, 32], found 31 error: invalid length: expected one of [36, 32], found 31
--> benches/macros/invalid_parse.rs:18:23 --> tests/ui/compile_fail/invalid_parse.rs:18:23
| |
18 | const _: Uuid = uuid!("67e5504410b1426f9247bb680e5fe0c"); 18 | const _: Uuid = uuid!("67e5504410b1426f9247bb680e5fe0c");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found X at 6 error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found X at 6
--> benches/macros/invalid_parse.rs:19:30 --> tests/ui/compile_fail/invalid_parse.rs:19:30
| |
19 | const _: Uuid = uuid!("67e550X410b1426f9247bb680e5fe0cd"); 19 | const _: Uuid = uuid!("67e550X410b1426f9247bb680e5fe0cd");
| ^ | ^
error: invalid group length: expected 8, found 6 in group 0 error: invalid group length: expected 8, found 6 in group 0
--> benches/macros/invalid_parse.rs:20:24 --> tests/ui/compile_fail/invalid_parse.rs:20:24
| |
20 | const _: Uuid = uuid!("67e550-4105b1426f9247bb680e5fe0c"); 20 | const _: Uuid = uuid!("67e550-4105b1426f9247bb680e5fe0c");
| ^^^^^^ | ^^^^^^
error: invalid group length: expected 4, found 5 in group 3 error: invalid group length: expected 4, found 5 in group 3
--> benches/macros/invalid_parse.rs:21:43 --> tests/ui/compile_fail/invalid_parse.rs:21:43
| |
21 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BF1-02BF39FA1E4"); 21 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BF1-02BF39FA1E4");
| ^^^^^ | ^^^^^
error: invalid length: expected one of [36, 32], found 35 error: invalid length: expected one of [36, 32], found 35
--> benches/macros/invalid_parse.rs:24:23 --> tests/ui/compile_fail/invalid_parse.rs:24:23
| |
24 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BBF-329BF39FA1E4"); 24 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BBF-329BF39FA1E4");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found G at 20 error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found G at 20
--> benches/macros/invalid_parse.rs:25:44 --> tests/ui/compile_fail/invalid_parse.rs:25:44
| |
25 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BGBF-329BF39FA1E4"); 25 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-BGBF-329BF39FA1E4");
| ^ | ^
error: invalid group length: expected 12, found 8 in group 4 error: invalid group length: expected 12, found 8 in group 4
--> benches/macros/invalid_parse.rs:26:48 --> tests/ui/compile_fail/invalid_parse.rs:26:48
| |
26 | const _: Uuid = uuid!("01020304-1112-2122-3132-41424344"); 26 | const _: Uuid = uuid!("01020304-1112-2122-3132-41424344");
| ^^^^^^^^ | ^^^^^^^^
error: invalid number of groups: expected one of [1, 5], found 4 error: invalid number of groups: expected one of [1, 5], found 4
--> benches/macros/invalid_parse.rs:27:23 --> tests/ui/compile_fail/invalid_parse.rs:27:23
| |
27 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BFF329BF39FA1E4"); 27 | const _: Uuid = uuid!("F9168C5E-CEB2-4faa-B6BFF329BF39FA1E4");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -17,4 +17,4 @@ const _: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");
// valid short // valid short
const _: Uuid = uuid!("67e5504410b1426f9247bb680e5fe0c8"); const _: Uuid = uuid!("67e5504410b1426f9247bb680e5fe0c8");
fn main() {} fn main() {}