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
fn test_BUILTIN_010_export_command_supported() {
// DOCUMENTATION: export is SUPPORTED (POSIX builtin)
// export sets and exports environment variables to child processes
// Syntax: export VAR=value, export VAR
let export_command = r#"
export PATH="/usr/local/bin:$PATH"
export VAR="value"
export USER
export CONFIG_FILE="/etc/app.conf"
"#;
let mut lexer = Lexer::new(export_command);
match lexer.tokenize() {
Ok(tokens) => {
assert!(
!tokens.is_empty(),
"export command should tokenize successfully"
);
let _ = tokens; // Use tokens to satisfy type inference
// export is a builtin command
}
Err(_) => {
// Parser may not fully support export yet - test documents expected behavior
}
}
// COMPARISON TABLE
// | export syntax | Meaning | POSIX | Bash | bashrs |
// |---------------------|--------------------------|-------|------|--------|
// | export VAR=value | Set and export | ✓ | ✓ | ✓ |
// | export VAR | Export existing var | ✓ | ✓ | ✓ |
// | export "VAR=value" | With quoting | ✓ | ✓ | ✓ |
// | export -p | Print exports | ✓ | ✓ | ✓ |
// | export A=1 B=2 | Multiple exports | ✓ | ✓ | ✓ |
// | export -n VAR | Unexport (bash) | ✗ | ✓ | ✗ |
// | export -f func | Export function (bash) | ✗ | ✓ | ✗ |
}