Skip to content

Commit ef72fe8

Browse files
committed
Fix up tests.
1 parent 61b9601 commit ef72fe8

File tree

6 files changed

+36
-39
lines changed

6 files changed

+36
-39
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ permissions:
1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1821

1922
steps:
2023
- uses: actions/checkout@v4
@@ -25,7 +28,7 @@ jobs:
2528
- name: Set up Python
2629
uses: actions/setup-python@v5
2730
with:
28-
python-version: "3.12"
31+
python-version: ${{ matrix.python-version }}
2932

3033
- name: Install Poetry
3134
uses: snok/install-poetry@v1
@@ -38,7 +41,7 @@ jobs:
3841
path: |
3942
~/.cache/pypoetry
4043
~/.cache/pip
41-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
44+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}
4245
restore-keys: |
4346
${{ runner.os }}-poetry-
4447

repren/repren.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ def rewrite_files(
625625
dry_run: bool = False,
626626
) -> None:
627627
paths = walk_files(root_paths, exclude_pat=exclude_pat)
628+
paths.sort() # Ensure deterministic order of file processing.
628629
log(None, "Found %s files in: %s" % (len(paths), ", ".join(root_paths)))
629630
for path in paths:
630631
rewrite_file(

tests/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ cp -a $dir/work-dir $dir/tmp-dir
2020
cd $dir/tmp-dir
2121

2222
echo "Running..."
23+
echo "Platform and Python version:"
24+
uname
25+
python -V
2326

2427
# Hackity hack:
2528
# Remove per-run and per-platform details to allow easy comparison.

tests/test.diff

Whitespace-only changes.

tests/tests-clean.log

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11

22
# --- Start of tests ---
33

4-
# Platform and Python version we're using to run tests.
5-
uname
6-
Darwin
74

8-
python -V
9-
Python 3.12.7
105

116
run || expect_error
127
usage: repren.py [-h] [--version] [--from FROM_PAT] [--to TO_PAT]
@@ -161,9 +156,9 @@ Using 5 patterns:
161156
'Asia' -> 'Asia!'
162157
'Europe' -> 'Europe!'
163158
Found 12 files in: test4
159+
- modify: test4/stuff/trees/beech.txt: 8 matches
164160
- modify: test4/stuff/trees/maple.txt: 3 matches
165161
- modify: test4/stuff/trees/oak.txt: 3 matches
166-
- modify: test4/stuff/trees/beech.txt: 8 matches
167162
Read 12 files (3810 chars), found 14 matches (0 skipped due to overlaps)
168163
Changed 3 files (3 rewritten and 0 renamed)
169164

@@ -205,12 +200,12 @@ Using 5 patterns:
205200
Found 12 files in: test5
206201
- modify: test5/humpty-dumpty.txt: 6 matches
207202
- rename: test5/humpty-dumpty.txt -> test5/dumpty-humpty.txt
208-
- rename: test5/stuff/words/Asia -> test5/stuff/words/Asia!
209-
- rename: test5/stuff/words/Europe -> test5/stuff/words/Europe!
210-
- modify: test5/stuff/trees/maple.txt: 3 matches
211-
- modify: test5/stuff/trees/oak.txt: 3 matches
212203
- modify: test5/stuff/trees/beech.txt: 10 matches
213204
- rename: test5/stuff/trees/beech.txt -> test5/stuff/trees/BEECH.txt
205+
- modify: test5/stuff/trees/maple.txt: 3 matches
206+
- modify: test5/stuff/trees/oak.txt: 3 matches
207+
- rename: test5/stuff/words/Asia -> test5/stuff/words/Asia!
208+
- rename: test5/stuff/words/Europe -> test5/stuff/words/Europe!
214209
Read 12 files (3810 chars), found 22 matches (0 skipped due to overlaps)
215210
Changed 6 files (4 rewritten and 4 renamed)
216211

@@ -291,17 +286,17 @@ Using 6 patterns:
291286
'c' -> 'a'
292287
Found 12 files in: test7
293288
- modify: test7/humpty-dumpty.txt: 40 matches
294-
- rename: test7/stuff/words/oak -> test7/stuff/words/obk
295-
- rename: test7/stuff/words/genetic -> test7/stuff/words/genetia
296-
- rename: test7/stuff/words/second -> test7/stuff/words/seaond
297-
- rename: test7/stuff/words/Asia -> test7/stuff/words/Bsib
298-
- rename: test7/stuff/words/Mexico -> test7/stuff/words/Mexiao
289+
- modify: test7/stuff/trees/beech.txt: 180 matches
290+
- rename: test7/stuff/trees/beech.txt -> test7/stuff/trees/ceeah.txt
299291
- modify: test7/stuff/trees/maple.txt: 43 matches
300292
- rename: test7/stuff/trees/maple.txt -> test7/stuff/trees/mbple.txt
301293
- modify: test7/stuff/trees/oak.txt: 161 matches
302294
- rename: test7/stuff/trees/oak.txt -> test7/stuff/trees/obk.txt
303-
- modify: test7/stuff/trees/beech.txt: 180 matches
304-
- rename: test7/stuff/trees/beech.txt -> test7/stuff/trees/ceeah.txt
295+
- rename: test7/stuff/words/Asia -> test7/stuff/words/Bsib
296+
- rename: test7/stuff/words/Mexico -> test7/stuff/words/Mexiao
297+
- rename: test7/stuff/words/genetic -> test7/stuff/words/genetia
298+
- rename: test7/stuff/words/oak -> test7/stuff/words/obk
299+
- rename: test7/stuff/words/second -> test7/stuff/words/seaond
305300
Read 12 files (3810 chars), found 424 matches (0 skipped due to overlaps)
306301
Changed 9 files (4 rewritten and 8 renamed)
307302

@@ -315,17 +310,17 @@ Using 6 patterns:
315310
'c' -> 'a'
316311
Found 12 files in: test7
317312
- modify: test7/humpty-dumpty.txt: 40 matches
318-
- rename: test7/stuff/words/obk -> test7/stuff/words/ock
319-
- rename: test7/stuff/words/Bsib -> test7/stuff/words/Csic
320-
- rename: test7/stuff/words/Mexiao -> test7/stuff/words/Mexibo
321-
- rename: test7/stuff/words/seaond -> test7/stuff/words/sebond
322-
- rename: test7/stuff/words/genetia -> test7/stuff/words/genetib
323313
- modify: test7/stuff/trees/ceeah.txt: 180 matches
324314
- rename: test7/stuff/trees/ceeah.txt -> test7/stuff/trees/aeebh.txt
325-
- modify: test7/stuff/trees/obk.txt: 161 matches
326-
- rename: test7/stuff/trees/obk.txt -> test7/stuff/trees/ock.txt
327315
- modify: test7/stuff/trees/mbple.txt: 43 matches
328316
- rename: test7/stuff/trees/mbple.txt -> test7/stuff/trees/mcple.txt
317+
- modify: test7/stuff/trees/obk.txt: 161 matches
318+
- rename: test7/stuff/trees/obk.txt -> test7/stuff/trees/ock.txt
319+
- rename: test7/stuff/words/Bsib -> test7/stuff/words/Csic
320+
- rename: test7/stuff/words/Mexiao -> test7/stuff/words/Mexibo
321+
- rename: test7/stuff/words/genetia -> test7/stuff/words/genetib
322+
- rename: test7/stuff/words/obk -> test7/stuff/words/ock
323+
- rename: test7/stuff/words/seaond -> test7/stuff/words/sebond
329324
Read 12 files (3810 chars), found 424 matches (0 skipped due to overlaps)
330325
Changed 9 files (4 rewritten and 8 renamed)
331326

@@ -339,17 +334,17 @@ Using 6 patterns:
339334
'c' -> 'a'
340335
Found 12 files in: test7
341336
- modify: test7/humpty-dumpty.txt: 40 matches
342-
- rename: test7/stuff/words/Csic -> test7/stuff/words/Asia
343-
- rename: test7/stuff/words/genetib -> test7/stuff/words/genetic
344-
- rename: test7/stuff/words/Mexibo -> test7/stuff/words/Mexico
345-
- rename: test7/stuff/words/sebond -> test7/stuff/words/second
346-
- rename: test7/stuff/words/ock -> test7/stuff/words/oak
347-
- modify: test7/stuff/trees/ock.txt: 161 matches
348-
- rename: test7/stuff/trees/ock.txt -> test7/stuff/trees/oak.txt
349337
- modify: test7/stuff/trees/aeebh.txt: 180 matches
350338
- rename: test7/stuff/trees/aeebh.txt -> test7/stuff/trees/beech.txt
351339
- modify: test7/stuff/trees/mcple.txt: 43 matches
352340
- rename: test7/stuff/trees/mcple.txt -> test7/stuff/trees/maple.txt
341+
- modify: test7/stuff/trees/ock.txt: 161 matches
342+
- rename: test7/stuff/trees/ock.txt -> test7/stuff/trees/oak.txt
343+
- rename: test7/stuff/words/Csic -> test7/stuff/words/Asia
344+
- rename: test7/stuff/words/Mexibo -> test7/stuff/words/Mexico
345+
- rename: test7/stuff/words/genetib -> test7/stuff/words/genetic
346+
- rename: test7/stuff/words/ock -> test7/stuff/words/oak
347+
- rename: test7/stuff/words/sebond -> test7/stuff/words/second
353348
Read 12 files (3810 chars), found 424 matches (0 skipped due to overlaps)
354349
Changed 9 files (4 rewritten and 8 renamed)
355350

@@ -369,9 +364,9 @@ Using 3 patterns:
369364
'\bc\b' -> 'a'
370365
Found 12 files in: test8
371366
- modify: test8/humpty-dumpty.txt: 4 matches
367+
- modify: test8/stuff/trees/beech.txt: 4 matches
372368
- modify: test8/stuff/trees/maple.txt: 2 matches
373369
- modify: test8/stuff/trees/oak.txt: 6 matches
374-
- modify: test8/stuff/trees/beech.txt: 4 matches
375370
Read 12 files (3810 chars), found 16 matches (0 skipped due to overlaps)
376371
Changed 4 files (4 rewritten and 0 renamed)
377372

tests/tests.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ set -v
3434

3535
# --- Start of tests ---
3636

37-
# Platform and Python version we're using to run tests.
38-
uname
39-
40-
python -V
41-
4237
run || expect_error
4338

4439
# Text replacements, no renames.

0 commit comments

Comments
 (0)