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:
- Normalize paths to forward slashes inside fypp before emitting line markers (consistent cross-platform output)
- 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.
Running
python test_fypp.pyon Windows produces 6 failures. The root cause is that fypp internally usesos.path.join(), which produces backslashes (\) on Windows, but the test expectations hardcode forward slashes (/).Failing tests:
test_line_numbering_argeval_macrocalltest_nested_include_in_folder_of_incfile2test_nested_include_in_incpath_linenumtest_search_include_linenumtest_file_var_root_abstest_file_var_substitutionExample:
test_search_include_linenumexpects"include/fypp1.inc"in line markers, but fypp outputs"include\fypp1.inc"on Windows.Possible fixes:
os.sepin 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.