summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2026-08-02 18:50:55 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2026-08-27 10:59:22 +0900
commit7bcfbab25b85785e3e9e6f86e79a65b833158f43 (patch)
treee8e491b82fb5ae94e594f4cf514a0f1482038b84
parent0a617cb8e000e41f464d4107bdfd08f828101f73 (diff)
tests: Move modify-json ordering test to tests/json-utils.scm.
* tests/node.scm ("modify-json, ordering"): Move to... * tests/json-utils.scm ("modify-json, ordering"): ... here.
-rw-r--r--tests/json-utils.scm12
-rw-r--r--tests/node.scm9
2 files changed, 11 insertions, 10 deletions
diff --git a/tests/json-utils.scm b/tests/json-utils.scm
index 3f0ad0b8a0d..30f63774345 100644
--- a/tests/json-utils.scm
+++ b/tests/json-utils.scm
@@ -56,7 +56,8 @@ captures the written output as a string."
56 "Mock modify-json* with input from the package.json procedure." 56 "Mock modify-json* with input from the package.json procedure."
57 (mock ((guix build utils) with-atomic-file-replacement 57 (mock ((guix build utils) with-atomic-file-replacement
58 with-atomic-file-replacement/mock) 58 with-atomic-file-replacement/mock)
59 (json-string->scm (apply modify-json all-arguments)))) 59 (json-string->scm (apply modify-json all-arguments)
60 #:ordered #t)))
60 61
61(test-begin "json-utils") 62(test-begin "json-utils")
62 63
@@ -214,6 +215,15 @@ captures the written output as a string."
214 ((modify-json-fields '(42) (lambda (field data key) data)) 215 ((modify-json-fields '(42) (lambda (field data key) data))
215 (fresh-sample-json))) 216 (fresh-sample-json)))
216 217
218(test-equal "modify-json, ordering"
219 '(("baz" . "^3.0.0")
220 ("qux" . "^4.0.0"))
221 (assoc-ref (modify-json* (modify-json-fields
222 '("devDependencies.qux")
223 (lambda (field-path data key)
224 data))) ;no-op
225 "devDependencies"))
226
217;;; 227;;;
218;;; modify-json (deprecated wrapper) 228;;; modify-json (deprecated wrapper)
219;;; 229;;;
diff --git a/tests/node.scm b/tests/node.scm
index 7328ac91e8e..55236f0df43 100644
--- a/tests/node.scm
+++ b/tests/node.scm
@@ -76,15 +76,6 @@ It also returns the data as an alist directly."
76 76
77(test-begin "node related tests") 77(test-begin "node related tests")
78 78
79(test-equal "modify-json, ordering"
80 '(("mkdirp" . ">=1.0.0")
81 ("react" . "^16.8.0"))
82 (assoc-ref (modify-json* (modify-json-fields
83 '("peerDependencies.react")
84 (lambda (field-path data key)
85 data)))
86 "peerDependencies"))
87
88(test-equal "delete-dependencies" 79(test-equal "delete-dependencies"
89 '(("domelementtype" . "^3.0.0")) 80 '(("domelementtype" . "^3.0.0"))
90 (assoc-ref (modify-json* 81 (assoc-ref (modify-json*