Skip to content

Commit d2e9f19

Browse files
test: tidy examples and integration tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent 134d73c commit d2e9f19

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

examples/test_tokens_debug.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ fn main() {
55
println!("Input: {}", input);
66

77
let mut lexer = Lexer::new(input.to_string());
8-
let mut tokens = Vec::new();
9-
108
loop {
119
match lexer.next_token() {
1210
Ok(token) => {
1311
println!("Token: {:?}", token);
1412
if token == libdplyr::lexer::Token::EOF {
1513
break;
1614
}
17-
tokens.push(token);
1815
}
1916
Err(e) => {
2017
println!("Error: {:?}", e);

tests/cli_integration_tests.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,10 @@ fn test_pretty_formatting() {
278278
let stdout = String::from_utf8(output.stdout).expect("Invalid UTF-8");
279279

280280
// Pretty format should have multiple lines with proper indentation
281-
let lines: Vec<&str> = stdout.lines().collect();
282-
assert!(lines.len() > 1, "Pretty format should have multiple lines");
281+
assert!(
282+
stdout.lines().count() > 1,
283+
"Pretty format should have multiple lines"
284+
);
283285
assert!(stdout.contains("SELECT"), "Should contain SELECT");
284286
assert!(stdout.contains("FROM"), "Should contain FROM");
285287
assert!(stdout.contains("WHERE"), "Should contain WHERE");

tests/json_output_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn test_json_output_integration() {
1717
.build();
1818

1919
// Test successful output
20-
let result = formatter.format_success("SELECT \"name\" FROM \"data\"", metadata.clone());
20+
let result = formatter.format_success("SELECT \"name\" FROM \"data\"", metadata);
2121
assert!(result.is_ok());
2222

2323
let json = result.unwrap();

0 commit comments

Comments
 (0)