Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reproduction case for failing quasiquoting when using JS backend #2193

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ let
cabal-project-nix-path = callTest ./cabal-project-nix-path {};
plugin = callTest ./plugin {};
supported-languages = callTest ./supported-langauges {};
js-template-haskell = callTest ./js-template-haskell {};
unit = unitTests;
};

Expand Down
27 changes: 27 additions & 0 deletions test/js-template-haskell/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test building TH code that needs DLLs when cross compiling for windows
{ stdenv, lib, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, ... }:

with lib;

let
project = project' {
inherit compiler-nix-name;
src = testSrc "js-template-haskell";
modules = [
# Fix node: createProcess: posix_spawnp: does not exist (No such file or directory)
# ({ pkgs,... }: {
# packages.js-template-haskell.components.library.build-tools = [ pkgs.pkgsBuildHost.nodejs ];
# })
];
};

packages = project.hsPkgs;

in recurseIntoAttrs {
ifdInputs = {
inherit (project) plan-nix;
};

build = packages.js-template-haskell.components.library;
build-profiled = packages.js-template-haskell.components.library.profiled;
}
16 changes: 16 additions & 0 deletions test/js-template-haskell/js-template-haskell.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cabal-version: 3.0
name: js-template-haskell
version: 0.1.0.0
category: Repro
build-type: Simple

common warnings
ghc-options: -Wall

library
import: warnings
exposed-modules: MyLib
build-depends: base
, uri-bytestring
hs-source-dirs: src
default-language: Haskell2010
8 changes: 8 additions & 0 deletions test/js-template-haskell/src/MyLib.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{-# LANGUAGE QuasiQuotes #-}

module MyLib (someFunc) where

import URI.ByteString.QQ

someFunc :: IO ()
someFunc = putStrLn $ show [uri|https://www.example.com/|]
Loading