guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 0707c17e084d7bbe1e9d34ac42b3689c9d77039c
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Sun Aug 2 18:50:55 2026 +0900
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.
---
tests/json-utils.scm | 12 +++++++++++-
tests/node.scm | 9 ---------
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."
"Mock modify-json* with input from the package.json procedure."
(mock ((guix build utils) with-atomic-file-replacement
with-atomic-file-replacement/mock)
- (json-string->scm (apply modify-json all-arguments))))
+ (json-string->scm (apply modify-json all-arguments)
+ #:ordered #t)))
(test-begin "json-utils")
@@ -214,6 +215,15 @@ captures the written output as a string."
((modify-json-fields '(42) (lambda (field data key) data))
(fresh-sample-json)))
+(test-equal "modify-json, ordering"
+ '(("baz" . "^3.0.0")
+ ("qux" . "^4.0.0"))
+ (assoc-ref (modify-json* (modify-json-fields
+ '("devDependencies.qux")
+ (lambda (field-path data key)
+ data))) ;no-op
+ "devDependencies"))
+
;;;
;;; modify-json (deprecated wrapper)
;;;
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."
(test-begin "node related tests")
-(test-equal "modify-json, ordering"
- '(("mkdirp" . ">=1.0.0")
- ("react" . "^16.8.0"))
- (assoc-ref (modify-json* (modify-json-fields
- '("peerDependencies.react")
- (lambda (field-path data key)
- data)))
- "peerDependencies"))
-
(test-equal "delete-dependencies"
'(("domelementtype" . "^3.0.0"))
(assoc-ref (modify-json*