summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/tests/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/bazel/rules_haskell/tests/encoding')
-rw-r--r--third_party/bazel/rules_haskell/tests/encoding/BUILD.bazel21
-rw-r--r--third_party/bazel/rules_haskell/tests/encoding/Main.hs8
-rw-r--r--third_party/bazel/rules_haskell/tests/encoding/TH.hs7
-rw-r--r--third_party/bazel/rules_haskell/tests/encoding/unicode.txt1
4 files changed, 37 insertions, 0 deletions
diff --git a/third_party/bazel/rules_haskell/tests/encoding/BUILD.bazel b/third_party/bazel/rules_haskell/tests/encoding/BUILD.bazel
new file mode 100644
index 000000000000..588d13f6d0b7
--- /dev/null
+++ b/third_party/bazel/rules_haskell/tests/encoding/BUILD.bazel
@@ -0,0 +1,21 @@
+load(
+    "@io_tweag_rules_haskell//haskell:haskell.bzl",
+    "haskell_test",
+)
+
+package(default_testonly = 1)
+
+haskell_test(
+    name = "encoding",
+    srcs = [
+        "Main.hs",
+        "TH.hs",
+    ],
+    extra_srcs = [
+        "unicode.txt",
+    ],
+    deps = [
+        "//tests/hackage:base",
+        "//tests/hackage:template-haskell",
+    ],
+)
diff --git a/third_party/bazel/rules_haskell/tests/encoding/Main.hs b/third_party/bazel/rules_haskell/tests/encoding/Main.hs
new file mode 100644
index 000000000000..beb5f2a29497
--- /dev/null
+++ b/third_party/bazel/rules_haskell/tests/encoding/Main.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module Main (main) where
+
+import TH
+
+main :: IO ()
+main = putStrLn $foo
diff --git a/third_party/bazel/rules_haskell/tests/encoding/TH.hs b/third_party/bazel/rules_haskell/tests/encoding/TH.hs
new file mode 100644
index 000000000000..8cb52b3f1139
--- /dev/null
+++ b/third_party/bazel/rules_haskell/tests/encoding/TH.hs
@@ -0,0 +1,7 @@
+module TH (foo) where
+
+import Language.Haskell.TH
+import Language.Haskell.TH.Syntax (lift)
+
+foo :: Q Exp
+foo = runIO (readFile "tests/encoding/unicode.txt") >>= lift
diff --git a/third_party/bazel/rules_haskell/tests/encoding/unicode.txt b/third_party/bazel/rules_haskell/tests/encoding/unicode.txt
new file mode 100644
index 000000000000..74e5f2638d08
--- /dev/null
+++ b/third_party/bazel/rules_haskell/tests/encoding/unicode.txt
@@ -0,0 +1 @@
+Некоторый текст на русском.