Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertEquals error diff separately tokenizes \ of escaped chars in strings #6326

Open
lionel-rowe opened this issue Jan 2, 2025 · 0 comments
Labels
assert bug Something isn't working

Comments

@lionel-rowe
Copy link
Contributor

Describe the bug

The error message of assertEquals separately tokenizes \ of escaped characters in strings, e.g \t representing a tab literal is treated as two separate tokens despite semantically being a single indivisible unit.

Steps to Reproduce

  1. Run the following in repl:
    import { assertEquals } from 'jsr:@std/[email protected]'
    const first = 'a\tb'
    const second = 'a\fb'
    assertEquals(first, second)
  2. Observe output, showing diff as a\[-tb]{+fb}
    image

Expected behavior

Diff to show as a[-\t]{+\f}b

Environment

@lionel-rowe lionel-rowe added bug Something isn't working needs triage labels Jan 2, 2025
@kt3k kt3k added assert and removed needs triage labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants