Skip to content

Commit 12b070e

Browse files
committed
fix: update tests to work with refactored typing_core
- Replace deleted current_char_to_display() with direct text access - Update create_typing_snapshot() to accept original_text parameter - Fix test compilation after removing unused typing_core methods - All 145 integration tests passing - All unit tests and scoring tests passing
1 parent 5110a64 commit 12b070e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/integration/languages/typing_core_common.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn verify_typing_simulation(core: &mut TypingCore) {
3434
let mut chars_typed = Vec::new();
3535

3636
while let Some(current_char_type) = core.current_char_to_type() {
37-
let current_char_display = core.current_char_to_display();
37+
let current_char_display = core.text_to_display().chars().nth(core.current_position_to_display());
3838

3939
// Test display position mapping
4040
let display_pos = core.current_position_to_display();
@@ -77,9 +77,9 @@ pub fn verify_typing_simulation(core: &mut TypingCore) {
7777
}
7878

7979
/// Create a snapshot for typing core test
80-
pub fn create_typing_snapshot(core: &TypingCore) -> TypingSnapshot {
80+
pub fn create_typing_snapshot(core: &TypingCore, original_text: &str) -> TypingSnapshot {
8181
TypingSnapshot {
82-
text_original: core.text_original().to_string(),
82+
text_original: original_text.to_string(),
8383
text_to_type: core.text_to_type().to_string(),
8484
text_to_display: core.text_to_display().to_string(),
8585
}
@@ -93,7 +93,7 @@ pub fn run_typing_core_test(test_case: TypingCoreTestCase) {
9393
// Verify typing simulation works correctly
9494
verify_typing_simulation(&mut core);
9595

96-
let snapshot = create_typing_snapshot(&core);
96+
let snapshot = create_typing_snapshot(&core, test_case.code);
9797
assert_snapshot!(test_case.name, snapshot);
9898
}
9999

0 commit comments

Comments
 (0)