Skip to content

Commit 4f00349

Browse files
committed
TST: Add test for diff_files
1 parent c8bda44 commit 4f00349

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/system_numpy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include <sys/time.h>
2+
#include <numpy/npy_math.h>

tests/test_wrapper.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
import glob
44
import os.path
55

6-
from check_python_h_first.wrapper import find_c_cpp_files, process_files, sort_order
6+
from check_python_h_first.wrapper import (
7+
diff_files,
8+
find_c_cpp_files,
9+
process_files,
10+
sort_order,
11+
)
712

813
THIS_DIR = os.path.dirname(__file__)
914

@@ -33,3 +38,9 @@ def test_process_files():
3338
os.path.basename(name).startswith("system")
3439
for name in HEADER_LIST + SOURCE_LIST
3540
)
41+
42+
43+
def test_diff_files():
44+
"""Test whether diff_files picks up the correct files."""
45+
new_files = [os.path.basename(name) for name in diff_files("c8bda44")]
46+
assert new_files == ["system_numpy.c"]

0 commit comments

Comments
 (0)