aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ghc-microlens-aeson-fix-tests.patch
blob: c1ef6a837c4141b22d9be6061523016c009b31e0 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 <https://github.com/bos/aeson/issues/568> for a discussion resulting
in a similar patch fixing the Aeson tests.

See <https://github.com/fosskers/microlens-aeson/issues/1> 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]"
...* etc/guix-install.sh (chk_sys_arch): Add "armv7l" case. Ludovic Courtès 2018-10-10etc: Use git-file-name if origin is git-fetch....* etc/snippets/scheme-mode/guix-origin: Use git-file-name. Pierre Neidhardt 2018-07-13etc: snippets: Add guix-commit-message-use-https-home-page....* etc/snippets/text-mode/guix-commit-message-use-https-home-page: New file. * doc/contributing.texi (The Perfect Setup): Document new snippet. Arun Isaac 2018-07-13etc: snippets: Add new build systems to package snippet....* etc/snippets/scheme-mode/guix-package: Add android-ndk-build-system and scons-build-system as possibilities for the build-system field. Arun Isaac 2018-07-03bash completion: Complete files names after 'guix weather -m'....* etc/completion/bash/guix (_guix_complete): Complete files names after 'guix weather -m'. Oleg Pykhalov 2018-07-03bash completion: Complete files names after 'guix build -L'....* etc/completion/bash/guix (_guix_complete): Complete files names after 'guix build -L'. Oleg Pykhalov 2018-06-16Add guix-daemon Bash completion file....* etc/completion/bash/guix-daemon: New file. * Makefile.am (dist_bashcompletion_DATA): Add this. Oleg Pykhalov 2018-05-19guix-install.sh: Fix chk_require exiting without warning....* etc/guix-install.sh (chk_require): Because of the set -e option, Bash was exiting when the command `command -v "$c" &>/dev/null' was running on its own. Instead, we now test the command and accumulate warning messages in a single statement by chaining the command with a logical OR. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Maxim Cournoyer 2018-03-29guix-install.sh: Explicitly set root's home directory....* etc/guix-install.sh (ROOT_HOME): New variable. (sys_create_store, sys_enable_guix_daemon, sys_authorize_build_farms): Use ROOT_HOME instead of ~root or the HOME environment variable. * doc/guix.texi (Binary Installation): Instead of assuming that ~ and $HOME refer to root's directory simply because commands are being run as root, explicilty refer to it via ~root. Fixes: <https://bugs.gnu.org/30728> Chris Marusich 2018-03-20Correct name and Email for ng0....* .mailmap: Correct name and Email for ng0. * Makefile.am, doc/guix.texi, etc/completion/fish/guix.fish gnu/packages/accessibility.scm, gnu/packages/admin.scm, gnu/packages/audio.scm, gnu/packages/autotools.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/cinnamon.scm, gnu/packages/compression.scm, gnu/packages/crypto.scm, gnu/packages/databases.scm, gnu/packages/django.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/enlightenment.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/forth.scm, gnu/packages/fvwm.scm, gnu/packages/games.scm, gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm, gnu/packages/haskell-check.scm, gnu/packages/haskell-crypto.scm, gnu/packages/haskell.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/language.scm, gnu/packages/libcanberra.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm, gnu/packages/ncurses.scm, gnu/packages/networking.scm, gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm, gnu/packages/perl-check.scm, gnu/packages/perl.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm, gnu/packages/telephony.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm, gnu/services/desktop.scm, gnu/services/version-control.scm, gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm: Likewise. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr> ng0 2018-02-21etc: guix-install.sh: Add aarch64-linux support....* etc/guix-install.sh (chk_sys_arch): Add aarch64 case. Efraim Flashner 2018-02-17bash completion: Complete files names after 'guix package -m'....* etc/completion/bash/guix (_guix_is_dash_m): New function. (_guix_complete): Add this. Oleg Pykhalov 2018-02-07etc: Add SELinux policy for the daemon....* etc/guix-daemon.cil.in: New file. * Makefile.am (dist_selinux_policy_DATA): Define it. * configure.ac: Handle --with-selinux-policy-dir. * doc/guix.texi (SELinux Support): New section. Ricardo Wurmus 2018-01-30etc: Add installation script....* etc/guix-install.sh: New file. * Makefile.am (EXTRA_DIST): Add it. * doc/guix.texi (Binary Installation): Mention it. Co-authored-by: sharlatan <sharlatanus@gmail.com> Ricardo Wurmus 2018-01-16etc: Add completions for fish....* etc/completion/fish/guix.fish: New file. * Makefile.am: Register the file. * configure.ac: Add the fish vendor-completions directory. Signed-off-by: Ludovic Courtès <ludo@gnu.org> ng0 2017-12-15etc: Add snippets....* etc/snippets/scheme-mode/guix-cvs-reference, etc/snippets/scheme-mode/guix-git-reference, etc/snippets/scheme-mode/guix-hg-reference, etc/snippets/scheme-mode/guix-origin, etc/snippets/scheme-mode/guix-package, etc/snippets/scheme-mode/guix-svn-reference, etc/snippets/text-mode/guix-commit-message-add-package, etc/snippets/text-mode/guix-commit-message-update-package: New files. * doc/contributing.texi (The Perfect Setup): Document snippets. Ricardo Wurmus 2017-08-22bash completion: Complete files names after 'guix download'....* etc/completion/bash/guix (_guix_complete): When the command is "download", use __guix_complete_file. Marius Bakke 2017-07-15Remove task from 'guix-daemon.conf'....The 'task' means that events that led to this job starting will be blocked until it has stopped. Tasks are short lived jobs, whereas the guix-daemon is a long lived service. Including 'task' means that attempts to start the guix-daemon appear to hang, as upstart waits for it to exit. * etc/guix-daemon.conf.in: Remove 'task'. Christopher Baines 2017-05-04etc: indent-code.el: Define source tree by "indent-code.el"....* etc/indent-code.el.in: Set default directory by "indent-code.el" itself, otherwise it works only when called from the top directory of the guix source tree. Alex Kost 2017-04-22Increase "TasksMax" in 'guix-daemon.service'....* etc/guix-daemon.service.in (TasksMax): Increase to 8192. Signed-off-by: Leo Famulari <leo@famulari.name> Sergei Trofimovich