summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2026-08-13 13:14:56 +0800
committerGitHub <[email protected]>2026-08-13 13:14:56 +0800
commit8bf5187281f1dcd3ea2f1cc41b1db5e9cf2cbc07 (patch)
tree4842257a6dec84ad6ea0cb5c9619e345ad3afd5b /tests
parentcd41cf60b38492309b32ac7b1238ef8669a8e3de (diff)
parent9de9c5f84075b54ed7bc82ac7928497c0fbafb91 (diff)
Merge pull request #7701 from jnhu76/fix/depend-nested-values-invalidation
fix(depend): detect appended nested values
Diffstat (limited to 'tests')
-rw-r--r--tests/modules/project_depend/test.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/modules/project_depend/test.lua b/tests/modules/project_depend/test.lua
new file mode 100644
index 000000000..2df79ba16
--- /dev/null
+++ b/tests/modules/project_depend/test.lua
@@ -0,0 +1,19 @@
+import("core.project.depend")
+
+function test_nested_values_append(t)
+ local dependinfo = {values = {{"clang", "-m64"}}}
+ local changed = depend.is_changed(dependinfo, {values = {{"clang", "-m64", "-DFEATURE_ON"}}})
+ t:require(changed)
+end
+
+function test_nested_values_remove(t)
+ local dependinfo = {values = {{"clang", "-m64", "-DFEATURE_ON"}}}
+ local changed = depend.is_changed(dependinfo, {values = {{"clang", "-m64"}}})
+ t:require(changed)
+end
+
+function test_nested_values_unchanged(t)
+ local dependinfo = {values = {{"clang", "-m64", "-DFEATURE_ON"}}}
+ local changed = depend.is_changed(dependinfo, {values = {{"clang", "-m64", "-DFEATURE_ON"}}})
+ t:require_not(changed)
+end