]> git.lizzy.rs Git - rust.git/blob - tests/camel_case.rs
Add implementation and tests for literal checking in print/println format args
[rust.git] / tests / camel_case.rs
1 extern crate clippy_lints;
2
3 use clippy_lints::utils::{camel_case_from, camel_case_until};
4
5 #[test]
6 fn from_full() {
7     assert_eq!(camel_case_from("AbcDef"), 0);
8     assert_eq!(camel_case_from("Abc"), 0);
9 }
10
11 #[test]
12 fn from_partial() {
13     assert_eq!(camel_case_from("abcDef"), 3);
14     assert_eq!(camel_case_from("aDbc"), 1);
15 }
16
17 #[test]
18 fn from_not() {
19     assert_eq!(camel_case_from("AbcDef_"), 7);
20     assert_eq!(camel_case_from("AbcDD"), 5);
21 }
22
23 #[test]
24 fn from_caps() {
25     assert_eq!(camel_case_from("ABCD"), 4);
26 }
27
28 #[test]
29 fn until_full() {
30     assert_eq!(camel_case_until("AbcDef"), 6);
31     assert_eq!(camel_case_until("Abc"), 3);
32 }
33
34 #[test]
35 fn until_not() {
36     assert_eq!(camel_case_until("abcDef"), 0);
37     assert_eq!(camel_case_until("aDbc"), 0);
38 }
39
40 #[test]
41 fn until_partial() {
42     assert_eq!(camel_case_until("AbcDef_"), 6);
43     assert_eq!(camel_case_until("CallTypeC"), 8);
44     assert_eq!(camel_case_until("AbcDD"), 3);
45 }
46
47 #[test]
48 fn until_caps() {
49     assert_eq!(camel_case_until("ABCD"), 0);
50 }