Skip to content

Commit b926679

Browse files
chansukepetrochenkov
authored andcommitted
Separate librustc_lint module
1 parent 0d77084 commit b926679

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

src/librustc_lint/nonstandard_style.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -440,26 +440,4 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
440440
}
441441

442442
#[cfg(test)]
443-
mod tests {
444-
use super::{is_camel_case, to_camel_case};
445-
446-
#[test]
447-
fn camel_case() {
448-
assert!(!is_camel_case("userData"));
449-
assert_eq!(to_camel_case("userData"), "UserData");
450-
451-
assert!(is_camel_case("X86_64"));
452-
453-
assert!(!is_camel_case("X86__64"));
454-
assert_eq!(to_camel_case("X86__64"), "X86_64");
455-
456-
assert!(!is_camel_case("Abc_123"));
457-
assert_eq!(to_camel_case("Abc_123"), "Abc123");
458-
459-
assert!(!is_camel_case("A1_b2_c3"));
460-
assert_eq!(to_camel_case("A1_b2_c3"), "A1B2C3");
461-
462-
assert!(!is_camel_case("ONE_TWO_THREE"));
463-
assert_eq!(to_camel_case("ONE_TWO_THREE"), "OneTwoThree");
464-
}
465-
}
443+
mod tests;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use super::{is_camel_case, to_camel_case};
2+
3+
#[test]
4+
fn camel_case() {
5+
assert!(!is_camel_case("userData"));
6+
assert_eq!(to_camel_case("userData"), "UserData");
7+
8+
assert!(is_camel_case("X86_64"));
9+
10+
assert!(!is_camel_case("X86__64"));
11+
assert_eq!(to_camel_case("X86__64"), "X86_64");
12+
13+
assert!(!is_camel_case("Abc_123"));
14+
assert_eq!(to_camel_case("Abc_123"), "Abc123");
15+
16+
assert!(!is_camel_case("A1_b2_c3"));
17+
assert_eq!(to_camel_case("A1_b2_c3"), "A1B2C3");
18+
19+
assert!(!is_camel_case("ONE_TWO_THREE"));
20+
assert_eq!(to_camel_case("ONE_TWO_THREE"), "OneTwoThree");
21+
}

0 commit comments

Comments
 (0)