Skip to content

Commit d8c069e

Browse files
unhappychoiceclaude
andcommitted
test: fix tests affected by File chunk addition
- Exclude File chunks from comment processing test to target original chunk - Update expected chunk counts in integration tests (+1 for File chunk) - Add ChunkType import to comment processing tests - These fixes ensure tests work correctly with the new File chunk for Zen mode 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4883150 commit d8c069e

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

tests/integration/comment_processing_tests.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use gittype::extractor::challenge_converter::ChallengeConverter;
66
use gittype::extractor::core::CommonExtractor;
77
use gittype::game::typing_core::TypingCore;
8+
use gittype::models::ChunkType;
89
use std::path::Path;
910

1011
/// Tests for the core bug: byte vs character position misalignment
@@ -110,8 +111,9 @@ mod byte_char_position_bugs {
110111
chunk.comment_ranges.len()
111112
);
112113

113-
// Look for the specific chunk with lines 9-14 (the problematic one)
114-
if chunk.start_line <= 14 && chunk.end_line >= 9 {
114+
// Look for the specific chunk with lines 9-14 (the problematic one), but exclude File chunks
115+
if chunk.start_line <= 14 && chunk.end_line >= 9 && chunk.chunk_type != ChunkType::File
116+
{
115117
println!(
116118
"Found target chunk (lines {}-{})",
117119
chunk.start_line, chunk.end_line

tests/integration/languages/java/extractor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test_language_extractor! {
2424
return this.message.length();
2525
}
2626
}"#,
27-
total_chunks: 6,
27+
total_chunks: 7,
2828
chunk_counts: {
2929
Class: 1,
3030
Method: 4,
@@ -82,7 +82,7 @@ public class Circle implements Drawable, Resizable {
8282
return radius * 2;
8383
}
8484
}"#,
85-
total_chunks: 23,
85+
total_chunks: 24,
8686
chunk_counts: {
8787
Class: 1,
8888
CodeBlock: 6,
@@ -124,7 +124,7 @@ public class ColorTest {
124124
System.out.println(color.getName());
125125
}
126126
}"##,
127-
total_chunks: 8,
127+
total_chunks: 9,
128128
chunk_counts: {
129129
Class: 1,
130130
Enum: 1,
@@ -157,7 +157,7 @@ test_language_extractor! {
157157
return age;
158158
}
159159
}"#,
160-
total_chunks: 8,
160+
total_chunks: 9,
161161
chunk_counts: {
162162
Class: 1,
163163
Method: 3,
@@ -303,7 +303,7 @@ class ProcessedItem {
303303
public long getTimestamp() { return timestamp; }
304304
}
305305
"#,
306-
total_chunks: 38,
306+
total_chunks: 39,
307307
chunk_counts: {
308308
Class: 3,
309309
Method: 12,

tests/integration/languages/rust/extractor.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn add(a: i32, b: i32) -> i32 {
1313
a + b
1414
}
1515
"#,
16-
total_chunks: 2,
16+
total_chunks: 3,
1717
chunk_counts: {
1818
Function: 2,
1919
}
@@ -33,7 +33,7 @@ pub struct Config {
3333
debug: bool,
3434
}
3535
"#,
36-
total_chunks: 2,
36+
total_chunks: 3,
3737
chunk_counts: {
3838
Struct: 2,
3939
}
@@ -55,7 +55,7 @@ enum Color {
5555
Blue,
5656
}
5757
"#,
58-
total_chunks: 2,
58+
total_chunks: 3,
5959
chunk_counts: {
6060
Enum: 2,
6161
}
@@ -78,7 +78,7 @@ trait Clone {
7878
fn clone(&self) -> Self;
7979
}
8080
"#,
81-
total_chunks: 3,
81+
total_chunks: 4,
8282
chunk_counts: {
8383
Function: 1,
8484
Trait: 2,
@@ -104,7 +104,7 @@ mod private_utils {
104104
fn internal_function() {}
105105
}
106106
"#,
107-
total_chunks: 5,
107+
total_chunks: 6,
108108
chunk_counts: {
109109
Function: 2,
110110
Module: 2,
@@ -121,7 +121,7 @@ pub type UserId = u64;
121121
pub type DatabaseResult<T> = Result<T, String>;
122122
type Point = (f64, f64);
123123
"#,
124-
total_chunks: 3,
124+
total_chunks: 4,
125125
chunk_counts: {
126126
TypeAlias: 3,
127127
}
@@ -172,7 +172,7 @@ pub fn create_user(name: String) -> User {
172172
}
173173
}
174174
"#,
175-
total_chunks: 9,
175+
total_chunks: 10,
176176
chunk_counts: {
177177
Class: 1,
178178
Enum: 1,
@@ -216,7 +216,7 @@ test_language_extractor! {
216216
}
217217
}
218218
"#,
219-
total_chunks: 10,
219+
total_chunks: 11,
220220
chunk_counts: {
221221
Class: 3,
222222
Function: 4,
@@ -238,7 +238,7 @@ fn calculate_sum(a: i32, b: i32) -> i32 {
238238
result
239239
}
240240
"#,
241-
total_chunks: 1,
241+
total_chunks: 2,
242242
chunk_counts: {
243243
Function: 1,
244244
}
@@ -314,7 +314,7 @@ pub fn advanced_string_matcher(patterns: &[&str], text: &str) -> Vec<(usize, Str
314314
matches
315315
}
316316
"#,
317-
total_chunks: 12,
317+
total_chunks: 13,
318318
chunk_counts: {
319319
Function: 2,
320320
}
@@ -388,7 +388,7 @@ impl<T: Clone> DataCache<T> {
388388
}
389389
}
390390
"#,
391-
total_chunks: 17,
391+
total_chunks: 18,
392392
chunk_counts: {
393393
Struct: 1,
394394
Function: 4,

0 commit comments

Comments
 (0)