This patch fixes the test suite to allow any order when listing the members of a JSON object. Aeson (being true to the JSON specification) does not specify an order for objects. In practice, the order depends on your processor architecture. See for a discussion resulting in a similar patch fixing the Aeson tests. See for the upstream bug report. diff -ruN a/test/Test.hs b/test/Test.hs --- a/test/Test.hs 2018-12-31 15:10:50.000000000 -0500 +++ b/test/Test.hs 2019-11-08 01:34:07.419706831 -0500 @@ -48,8 +48,10 @@ , testCase "" $ ("{\"a\": {}, \"b\": null}" ^? key (T.pack "b") . _Object) @?= Nothing , testCase "" $ ("{\"a\": 100, \"b\": 200}" ^? key (T.pack "a")) @?= Just (Number 100.0) , testCase "" $ ("[1,2,3]" ^? key (T.pack "a")) @?= Nothing - , testCase "" $ ("{\"a\": 4, \"b\": 7}" ^.. members) @?= [Number 4.0,Number 7.0] - , testCase "" $ ("{\"a\": 4, \"b\": 7}" & members . _Number %~ (* 10)) @?= "{\"a\":40,\"b\":70}" + , testCase "" $ assertBool "" (let x = ("{\"a\": 4, \"b\": 7}" ^.. members) + in x == [Number 4.0,Number 7.0] || x == [Number 7.0,Number 4.0]) + , testCase "" $ assertBool "" (let x = ("{\"a\": 4, \"b\": 7}" & members . _Number %~ (* 10)) + in x == "{\"a\":40,\"b\":70}" || x == "{\"b\":70,\"a\":40}") , testCase "" $ ("[1,2,3]" ^? nth 1) @?= Just (Number 2.0) , testCase "" $ ("{\"a\": 100, \"b\": 200}" ^? nth 1) @?= Nothing , testCase "" $ ("[1,2,3]" & nth 1 .~ Number 20) @?= "[1,20,3]" >
AgeCommit message (Expand)Author
2018-10-18services: dhcp-client: Deprecate 'dhcp-client-service' procedure....* gnu/services/networking.scm (dhcp-client-service-type): Add default value. * gnu/system/examples/bare-bones.tmpl: Use (service dhcp-client-service-type) instead of (dhcp-client-service). * gnu/system/examples/beaglebone-black.tmpl: Likewise. * gnu/tests/base.scm (%avahi-os): Likewise. * gnu/tests/databases.scm (%memcached-os): Likewise. (%mongodb-os): Likewise. * gnu/tests/dict.scm (%dicod-os): Likewise. * gnu/tests/mail.scm (%opensmtpd-os): Likewise. (%exim-os): Likewise. (%dovecot-os): Likewise. * gnu/tests/messaging.scm (run-xmpp-test): Likewise. (run-bitlbee-test): Likewise. * gnu/tests/monitoring.scm (%prometheus-node-exporter-os): Likewise. * gnu/tests/networking.scm (%inetd-os): Likewise. (run-iptables-test): Likewise. * gnu/tests/nfs.scm (%base-os): Likewise. * gnu/tests/rsync.scm (%rsync-os): Likewise. * gnu/tests/ssh.scm (run-ssh-test): Likewise. * gnu/tests/version-control.scm (%cgit-os): Likewise. (%git-http-os): Likewise. (%gitolite-os): Likewise. * gnu/tests/virtualization.scm (%libvirt-os): Likewise. * gnu/tests/web.scm (%httpd-os): Likewise. (%nginx-os): Likewise. (%varnish-os): Likewise. (%php-fpm-os): Likewise. (%hpcguix-web-os): Likewise. (%tailon-os): Likewise. * tests/guix-system.sh: Likewise. * doc/guix.texi (Networking Services): Document 'dhcp-client-service-type' and remove 'dhcp-client-service'. Ludovic Courtès
2017-08-23tests: Add 'libvirt-service-type' test....* gnu/tests/virtualization.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Christopher Baines