Skip to content

Commit 1cef6f7

Browse files
committed
Normalize line endings in test comparison
Makes test platform-independent by normalizing line endings when comparing context values on Windows vs Unix systems.
1 parent e814f0b commit 1cef6f7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
blank_issues_enabled: false
1+
blank_issues_enabled: true
22
contact_links:
33
- name: Ask a question
44
url: https://github.com/opcodesio/log-viewer/discussions/new?category=q-a

tests/Unit/LaravelLogs/LaravelLogsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,11 @@
311311

312312
$log = new LaravelLog($logText);
313313

314+
// Normalize line endings for cross-platform comparison
315+
$normalizedContext = str_replace(["\r\n", "\r"], "\n", $log->context['exception']);
316+
314317
expect($log->context)->toHaveKey('exception')
315-
->and($log->context['exception'])->toBe($stackTrace)
318+
->and($normalizedContext)->toBe($stackTrace)
316319
->and($log->context['exception'])->toContain('/vendor/symfony/http-kernel/')
317320
->and($log->context['exception'])->toContain('/vendor/laravel/framework/');
318321
});

0 commit comments

Comments
 (0)