From 661e93553ae48af410895477c339be4f0a203437 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sun, 9 Feb 2025 22:22:17 -0800 Subject: [PATCH] test: update snapshot tests to melange v5 --- flake.lock | 48 +++++-------------------------- ppx/test/react.t | 24 +++++++++------- test/blackbox-tests/useCallback.t | 16 +++++++---- 3 files changed, 30 insertions(+), 58 deletions(-) diff --git a/flake.lock b/flake.lock index 970254ed5..466aec2e2 100644 --- a/flake.lock +++ b/flake.lock @@ -1,34 +1,15 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1723398011, - "narHash": "sha256-LgKXKfdRhV1+drzKpsljUFhseRGL8eLKJR+DWp7nFuE=", + "lastModified": 1739164772, + "narHash": "sha256-DlcAsid/PovJMRc2kHQK3jr/pwXDl5AHf9KW4juYJwA=", "owner": "nix-ocaml", "repo": "nix-overlays", - "rev": "f5b06554ac5b1ac77c7911e35ee7f74b4aa8785a", + "rev": "e8ab9d047597fd471920f9f5f421e01ce8c0b0f0", "type": "github" }, "original": { @@ -39,17 +20,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1723316219, - "narHash": "sha256-2B9qh8QBvw3kV/8cHc7ZJcrbVsRwP8wKjkwPXTSz76Y=", + "lastModified": 1739097848, + "narHash": "sha256-bbdQB0Y4mB2msqbyQ9QC+YPDZGt1evUK53AwQSyShHM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bef98989a27429e1cb9e3d9c25701ba2da742af2", + "rev": "9a0b855695c31ea653181b742c65e026bada3881", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "bef98989a27429e1cb9e3d9c25701ba2da742af2", + "rev": "9a0b855695c31ea653181b742c65e026bada3881", "type": "github" } }, @@ -57,21 +38,6 @@ "inputs": { "nixpkgs": "nixpkgs" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/ppx/test/react.t b/ppx/test/react.t index eb7c3f080..b6cee36dc 100644 --- a/ppx/test/react.t +++ b/ppx/test/react.t @@ -40,16 +40,16 @@ Demonstrate how to use the React JSX PPX function X$App(Props) { return Belt__Belt_List.toArray(Belt__Belt_List.map({ - hd: "Hello!", - tl: { - hd: "This is React!", - tl: /* [] */0 - } - }, (function (greeting) { - return JsxRuntime.jsx("h1", { - children: greeting - }); - }))); + hd: "Hello!", + tl: { + hd: "This is React!", + tl: /* [] */ 0 + } + }, (function (greeting) { + return JsxRuntime.jsx("h1", { + children: greeting + }); + }))); } const App = { @@ -60,5 +60,7 @@ Demonstrate how to use the React JSX PPX JsxRuntime.jsx(X$App, {}); - exports.App = App; + module.exports = { + App, + } /* Not a pure module */ diff --git a/test/blackbox-tests/useCallback.t b/test/blackbox-tests/useCallback.t index 58749b525..c77fa812f 100644 --- a/test/blackbox-tests/useCallback.t +++ b/test/blackbox-tests/useCallback.t @@ -24,10 +24,12 @@ const React = require("react"); const cb = React.useCallback((function (a, b) { - return a + b | 0; - }), []); + return a + b | 0; + }), []); - exports.cb = cb; + module.exports = { + cb, + } /* cb Not a pure module */ Using an Uncurried function: @@ -45,9 +47,11 @@ Using an Uncurried function: const React = require("react"); const cb = React.useCallback((function (a, b) { - return a + b | 0; - }), []); + return a + b | 0; + }), []); - exports.cb = cb; + module.exports = { + cb, + } /* cb Not a pure module */