aboutsummaryrefslogtreecommitdiff
path: root/scripts/tests
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tests')
-rw-r--r--scripts/tests/sync-check.bats30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/tests/sync-check.bats b/scripts/tests/sync-check.bats
index df775b3..17c9189 100644
--- a/scripts/tests/sync-check.bats
+++ b/scripts/tests/sync-check.bats
@@ -84,3 +84,33 @@ setup() {
[ "$status" -eq 2 ]
[[ "$output" == *"not inside a git checkout"* ]]
}
+
+@test "generated Python artifacts in mirror don't count as drift" {
+ mkdir -p .ai/scripts/__pycache__
+ touch .ai/scripts/__pycache__/foo.cpython-314.pyc
+ touch .ai/scripts/some.pyc
+ run scripts/sync-check.sh
+ [ "$status" -eq 0 ]
+}
+
+@test "compiled elisp artifacts in mirror don't count as drift" {
+ touch .ai/scripts/foo.elc
+ run scripts/sync-check.sh
+ [ "$status" -eq 0 ]
+}
+
+@test "pytest cache in mirror doesn't count as drift" {
+ mkdir -p .ai/scripts/.pytest_cache
+ touch .ai/scripts/.pytest_cache/CACHEDIR.TAG
+ run scripts/sync-check.sh
+ [ "$status" -eq 0 ]
+}
+
+@test "--fix preserves generated artifacts in mirror" {
+ mkdir -p .ai/scripts/__pycache__
+ touch .ai/scripts/__pycache__/foo.cpython-314.pyc
+ echo "drift" > .ai/protocols.org
+ run scripts/sync-check.sh --fix
+ [ "$status" -eq 0 ]
+ [ -f .ai/scripts/__pycache__/foo.cpython-314.pyc ]
+}