1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Generated by: DEPYLER stdlib validation Phase 1
// Module: string - Python string constants validation
// Status: GREEN phase - Tests enabled
use depyler_core::transpile_python_to_rust;
// Note: These 3 constants were already implemented (plus 5 more!)
// Already existing: ascii_lowercase, ascii_uppercase, ascii_letters,
// digits, hexdigits, octdigits, punctuation, whitespace, printable
// DEPYLER-STDLIB-STRING-CONSTANTS-001: ASCII character constants
#[test]
fn test_ascii_lowercase() {
let python = r#"
import string
def get_lowercase() -> str:
return string.ascii_lowercase
"#;
let result = transpile_python_to_rust(python).expect("Transpilation failed");
// Should return lowercase ASCII letters
assert!(result.contains("abcdefghijklmnopqrstuvwxyz"));
}
#[test]
fn test_ascii_uppercase() {
let python = r#"
import string
def get_uppercase() -> str:
return string.ascii_uppercase
"#;
let result = transpile_python_to_rust(python).expect("Transpilation failed");
// Should return uppercase ASCII letters
assert!(result.contains("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
}
#[test]
fn test_ascii_letters() {
let python = r#"
import string
def get_letters() -> str:
return string.ascii_letters
"#;
let result = transpile_python_to_rust(python).expect("Transpilation failed");
// Should return all ASCII letters
assert!(result.contains("abcdefghijklmnopqrstuvwxyz") && result.contains("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
}
// Total: 3 string module constants verified (8 total already exist)
// Coverage: ascii_lowercase, ascii_uppercase, ascii_letters