From 48e367cb11264ef5def4ab681a77cab393edc281 Mon Sep 17 00:00:00 2001 From: Taus Date: Tue, 16 Apr 2024 17:18:20 +0000 Subject: [PATCH] Python: Remove test with CRLF line endings These were causing `git` to behave strangely, leaving files that were impossible to reset. In the future we should probably generate these problematic test files on the fly, so that they don't have to exist in the repo, but in the short run, it's easier to just remove them so as to not block other users of the repo. --- .../extractor-tests/line_endings/README.md | 1 + .../line_endings/Test.expected | 4 --- .../test/extractor-tests/line_endings/Test.ql | 4 --- .../line_endings/continuation.py | 4 --- .../extractor-tests/line_endings/feeds.py | 4 --- .../line_endings/string_cr_conversion.py | 1 - .../test/extractor-tests/line_endings/test.py | 28 ------------------- 7 files changed, 1 insertion(+), 45 deletions(-) create mode 100644 python/ql/test/extractor-tests/line_endings/README.md delete mode 100644 python/ql/test/extractor-tests/line_endings/Test.expected delete mode 100644 python/ql/test/extractor-tests/line_endings/Test.ql delete mode 100644 python/ql/test/extractor-tests/line_endings/continuation.py delete mode 100644 python/ql/test/extractor-tests/line_endings/feeds.py delete mode 100644 python/ql/test/extractor-tests/line_endings/string_cr_conversion.py delete mode 100644 python/ql/test/extractor-tests/line_endings/test.py diff --git a/python/ql/test/extractor-tests/line_endings/README.md b/python/ql/test/extractor-tests/line_endings/README.md new file mode 100644 index 000000000000..0e7612377255 --- /dev/null +++ b/python/ql/test/extractor-tests/line_endings/README.md @@ -0,0 +1 @@ +The test files in this directory were causing some issues with `git`, due to the use of CRLF line endings. For this reason they have been temporarily removed. You can consult the commit history for when this file was added to see what they looked like. diff --git a/python/ql/test/extractor-tests/line_endings/Test.expected b/python/ql/test/extractor-tests/line_endings/Test.expected deleted file mode 100644 index f50d6411ff44..000000000000 --- a/python/ql/test/extractor-tests/line_endings/Test.expected +++ /dev/null @@ -1,4 +0,0 @@ -| continuation | -| feeds | -| string_cr_conversion | -| test | diff --git a/python/ql/test/extractor-tests/line_endings/Test.ql b/python/ql/test/extractor-tests/line_endings/Test.ql deleted file mode 100644 index be1451def96c..000000000000 --- a/python/ql/test/extractor-tests/line_endings/Test.ql +++ /dev/null @@ -1,4 +0,0 @@ -import python - -from Module m -select m.getName() diff --git a/python/ql/test/extractor-tests/line_endings/continuation.py b/python/ql/test/extractor-tests/line_endings/continuation.py deleted file mode 100644 index 3d1e801e99d1..000000000000 --- a/python/ql/test/extractor-tests/line_endings/continuation.py +++ /dev/null @@ -1,4 +0,0 @@ -def foo(): - pass \ -\ -\ diff --git a/python/ql/test/extractor-tests/line_endings/feeds.py b/python/ql/test/extractor-tests/line_endings/feeds.py deleted file mode 100644 index f23d77bd7fa3..000000000000 --- a/python/ql/test/extractor-tests/line_endings/feeds.py +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/python/ql/test/extractor-tests/line_endings/string_cr_conversion.py b/python/ql/test/extractor-tests/line_endings/string_cr_conversion.py deleted file mode 100644 index 0c3ba16b86ed..000000000000 --- a/python/ql/test/extractor-tests/line_endings/string_cr_conversion.py +++ /dev/null @@ -1 +0,0 @@ -# this file has CR line endings to test lexer's conversion of them to LF # in triple quoted strings print(repr("""abc def""")) \ No newline at end of file diff --git a/python/ql/test/extractor-tests/line_endings/test.py b/python/ql/test/extractor-tests/line_endings/test.py deleted file mode 100644 index 88d3fe3c7bfc..000000000000 --- a/python/ql/test/extractor-tests/line_endings/test.py +++ /dev/null @@ -1,28 +0,0 @@ - -# write a frame to the screen. -# Interpolate values based on percent -def interpolate_frame(screen, pcnt, grid, line): - """ Interpolate new values by reading from grid and - writing to the screen """ - # each row interpolates with the one before it - for y in range(DISPLAY_HEIGHT-1, 0, -1): - for x in range(DISPLAY_WIDTH): - mask = MASK[y][x] - newval = ((100-pcnt) * grid[y][x] + pcnt * grid[y-1][x] ) / 100.0 - newval = mask * newval / 100.0 - if INVERT_DISPLAY: - screen.set_pixel(x, DISPLAY_HEIGHT-y-1, int(newval)) - else: - screen.set_pixel(x, y, int(newval)) - # first row interpolates with the "next" line - for x in range(DISPLAY_WIDTH): - mask = MASK[y][x] - newval = ((100-pcnt) * grid[0][x] + pcnt * line[x]) / 100.0 - newval = mask * newval / 100.0 - if INVERT_DISPLAY: - screen.set_pixel(x, DISPLAY_HEIGHT-1, int(newval)) - else: - screen.set_pixel(x, 0, int(newval)) - -## Setup -line = generate_line()