- ✅
test_interpolate_string_simple- Single variable interpolation - ✅
test_interpolate_string_number- Number interpolation - ✅
test_interpolate_string_boolean- Boolean interpolation - ✅
test_interpolate_string_multiple- Multiple variables in one string
- ✅
test_interpolate_string_no_variables- String without any variables - ✅
test_interpolate_string_escaped_braces- Escaped{{braces - ✅
test_interpolate_string_escaped_closing- Escaped}}braces
- ✅
test_interpolate_string_undefined_variable- Undefined variable error - ✅
test_interpolate_string_empty_variable- Empty{}error - ✅
test_interpolate_string_unclosed_brace- Missing closing}error
- ✅
test_string_interpolation_basic- Basic interpolation with string variable - ✅
test_string_interpolation_number- Interpolation with number variable - ✅
test_string_interpolation_boolean- Interpolation with boolean variable - ✅
test_string_interpolation_multiple- Multiple variables in statement - ✅
test_string_interpolation_undefined_variable- Error handling for undefined vars - ✅
test_string_without_interpolation- Plain text without variables
Total Tests: 27 (increased from 11)
- Frontend (Lexer/Parser): 4 tests
- Runtime (Interpreter): 9 tests
- Builtins (Print): 14 tests
- Utils (Integration): 4 tests
String Interpolation Coverage: 20 tests
- Unit tests: 14
- Integration tests: 6
- Single variable interpolation
- Multiple variables in one string
- Different data types (string, number, boolean)
- Text without interpolation
- Escaped braces (
{{and}})
- Undefined variables
- Empty variable names
{} - Unclosed braces
{name - Invalid characters in variable names
- Proper error messages
- Correct string concatenation
- Type-to-string conversion
- Variable lookup in scope
# Run all tests
cargo test
# Run only interpolation tests
cargo test interpolate
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test test_interpolate_string_simplelet name = "Alice"
print("Hello {name}") // Output: Hello Alicelet name = "Bob"
let age = 30
print("{name} is {age}") // Output: Bob is 30print("Hello {undefined}") // Error: Undefined variable: undefinedprint("Literal {{braces}}") // Output: Literal {braces}