Skip to content

6 tests fail on Windows due to hardcoded forward-slash path separators in test expectations #65

@ijatinydv

Description

@ijatinydv

Running python test_fypp.py on Windows produces 6 failures. The root cause is that fypp internally uses os.path.join(), which produces backslashes (\) on Windows, but the test expectations hardcode forward slashes (/).

Failing tests:

  • test_line_numbering_argeval_macrocall
  • test_nested_include_in_folder_of_incfile2
  • test_nested_include_in_incpath_linenum
  • test_search_include_linenum
  • test_file_var_root_abs
  • test_file_var_substitution

Example: test_search_include_linenum expects "include/fypp1.inc" in line markers, but fypp outputs "include\fypp1.inc" on Windows.

Possible fixes:

  1. Normalize paths to forward slashes inside fypp before emitting line markers (consistent cross-platform output)
  2. Use os.sep in test expectations (tests pass on both platforms, but output differs)

Option 1 is preferred because emitting raw backslashes in line directives (e.g., # 1 "include\test.inc") can potentially trigger unwanted escape sequence parsing (\t) in downstream compilers. Normalizing to / ensures identical, safe output across all operating systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions