Skip to content

Commit 8249ca9

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

File tree

6 files changed

+36
-41
lines changed

6 files changed

+36
-41
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 & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11

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

4-
# Platform and Python version we're using to run tests.
5-
uname
6-
Darwin
7-
8-
python -V
9-
Python 3.12.7
10-
114
run || expect_error
125
usage: repren.py [-h] [--version] [--from FROM_PAT] [--to TO_PAT]
136
[-p PAT_FILE] [--full] [--renames] [--literal] [-i]
@@ -161,9 +154,9 @@ Using 5 patterns:
161154
'Asia' -> 'Asia!'
162155
'Europe' -> 'Europe!'
163156
Found 12 files in: test4
157+
- modify: test4/stuff/trees/beech.txt: 8 matches
164158
- modify: test4/stuff/trees/maple.txt: 3 matches
165159
- modify: test4/stuff/trees/oak.txt: 3 matches
166-
- modify: test4/stuff/trees/beech.txt: 8 matches
167160
Read 12 files (3810 chars), found 14 matches (0 skipped due to overlaps)
168161
Changed 3 files (3 rewritten and 0 renamed)
169162

@@ -205,12 +198,12 @@ Using 5 patterns:
205198
Found 12 files in: test5
206199
- modify: test5/humpty-dumpty.txt: 6 matches
207200
- 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
212201
- modify: test5/stuff/trees/beech.txt: 10 matches
213202
- rename: test5/stuff/trees/beech.txt -> test5/stuff/trees/BEECH.txt
203+
- modify: test5/stuff/trees/maple.txt: 3 matches
204+
- modify: test5/stuff/trees/oak.txt: 3 matches
205+
- rename: test5/stuff/words/Asia -> test5/stuff/words/Asia!
206+
- rename: test5/stuff/words/Europe -> test5/stuff/words/Europe!
214207
Read 12 files (3810 chars), found 22 matches (0 skipped due to overlaps)
215208
Changed 6 files (4 rewritten and 4 renamed)
216209

@@ -291,17 +284,17 @@ Using 6 patterns:
291284
'c' -> 'a'
292285
Found 12 files in: test7
293286
- 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
287+
- modify: test7/stuff/trees/beech.txt: 180 matches
288+
- rename: test7/stuff/trees/beech.txt -> test7/stuff/trees/ceeah.txt
299289
- modify: test7/stuff/trees/maple.txt: 43 matches
300290
- rename: test7/stuff/trees/maple.txt -> test7/stuff/trees/mbple.txt
301291
- modify: test7/stuff/trees/oak.txt: 161 matches
302292
- 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
293+
- rename: test7/stuff/words/Asia -> test7/stuff/words/Bsib
294+
- rename: test7/stuff/words/Mexico -> test7/stuff/words/Mexiao
295+
- rename: test7/stuff/words/genetic -> test7/stuff/words/genetia
296+
- rename: test7/stuff/words/oak -> test7/stuff/words/obk
297+
- rename: test7/stuff/words/second -> test7/stuff/words/seaond
305298
Read 12 files (3810 chars), found 424 matches (0 skipped due to overlaps)
306299
Changed 9 files (4 rewritten and 8 renamed)
307300

@@ -315,17 +308,17 @@ Using 6 patterns:
315308
'c' -> 'a'
316309
Found 12 files in: test7
317310
- 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
323311
- modify: test7/stuff/trees/ceeah.txt: 180 matches
324312
- 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
327313
- modify: test7/stuff/trees/mbple.txt: 43 matches
328314
- rename: test7/stuff/trees/mbple.txt -> test7/stuff/trees/mcple.txt
315+
- modify: test7/stuff/trees/obk.txt: 161 matches
316+
- rename: test7/stuff/trees/obk.txt -> test7/stuff/trees/ock.txt
317+
- rename: test7/stuff/words/Bsib -> test7/stuff/words/Csic
318+
- rename: test7/stuff/words/Mexiao -> test7/stuff/words/Mexibo
319+
- rename: test7/stuff/words/genetia -> test7/stuff/words/genetib
320+
- rename: test7/stuff/words/obk -> test7/stuff/words/ock
321+
- rename: test7/stuff/words/seaond -> test7/stuff/words/sebond
329322
Read 12 files (3810 chars), found 424 matches (0 skipped due to overlaps)
330323
Changed 9 files (4 rewritten and 8 renamed)
331324

@@ -339,17 +332,17 @@ Using 6 patterns:
339332
'c' -> 'a'
340333
Found 12 files in: test7
341334
- 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
349335
- modify: test7/stuff/trees/aeebh.txt: 180 matches
350336
- rename: test7/stuff/trees/aeebh.txt -> test7/stuff/trees/beech.txt
351337
- modify: test7/stuff/trees/mcple.txt: 43 matches
352338
- rename: test7/stuff/trees/mcple.txt -> test7/stuff/trees/maple.txt
339+
- modify: test7/stuff/trees/ock.txt: 161 matches
340+
- rename: test7/stuff/trees/ock.txt -> test7/stuff/trees/oak.txt
341+
- rename: test7/stuff/words/Csic -> test7/stuff/words/Asia
342+
- rename: test7/stuff/words/Mexibo -> test7/stuff/words/Mexico
343+
- rename: test7/stuff/words/genetib -> test7/stuff/words/genetic
344+
- rename: test7/stuff/words/ock -> test7/stuff/words/oak
345+
- rename: test7/stuff/words/sebond -> test7/stuff/words/second
353346
Read 12 files (3810 chars), found 424 matches (0 skipped due to overlaps)
354347
Changed 9 files (4 rewritten and 8 renamed)
355348

@@ -369,9 +362,9 @@ Using 3 patterns:
369362
'\bc\b' -> 'a'
370363
Found 12 files in: test8
371364
- modify: test8/humpty-dumpty.txt: 4 matches
365+
- modify: test8/stuff/trees/beech.txt: 4 matches
372366
- modify: test8/stuff/trees/maple.txt: 2 matches
373367
- modify: test8/stuff/trees/oak.txt: 6 matches
374-
- modify: test8/stuff/trees/beech.txt: 4 matches
375368
Read 12 files (3810 chars), found 16 matches (0 skipped due to overlaps)
376369
Changed 4 files (4 rewritten and 0 renamed)
377370

‎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)