diff options
author | Griffin Smith <grfn@gws.fyi> | 2021-06-14T03·11-0400 |
---|---|---|
committer | grfn <grfn@gws.fyi> | 2021-06-14T13·04+0000 |
commit | b2637edc236510bbb8d1c630e2348a00261c5094 (patch) | |
tree | 535f9eeaa48875d34653ef71d7d655ae1c7976d8 /users/grfn/emacs.d/snippets | |
parent | bf79617bd844697258d0a87157b7ceb50597e37d (diff) |
feat(gs/emacs): Revamp haskell test-mode snippet r/2662
This is how I'm writing test files for xanthous now, and I'm not writing any other haskell code, so let's update the snippet Change-Id: Ia513490ee1cfc87b3d58ee1a8e94244f2e862963 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3208 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/emacs.d/snippets')
-rw-r--r-- | users/grfn/emacs.d/snippets/haskell-mode/test-module | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/users/grfn/emacs.d/snippets/haskell-mode/test-module b/users/grfn/emacs.d/snippets/haskell-mode/test-module index 82224b36a49e..036b0ae9983a 100644 --- a/users/grfn/emacs.d/snippets/haskell-mode/test-module +++ b/users/grfn/emacs.d/snippets/haskell-mode/test-module @@ -3,7 +3,6 @@ # key: test # expand-env: ((yas-indent-line 'fixed)) # -- -{-# LANGUAGE ApplicativeDo #-} -------------------------------------------------------------------------------- module ${1:`(if (not buffer-file-name) "Module" (let ((name (file-name-sans-extension (buffer-file-name))) @@ -12,11 +11,17 @@ module ${1:`(if (not buffer-file-name) "Module" (replace-regexp-in-string "/" "." (replace-regexp-in-string "^\/[^A-Z]*" "" (car (last (split-string name "src"))))) - (file-name-nondirectory name))))`} where + (file-name-nondirectory name))))`} (main, test) where -------------------------------------------------------------------------------- import Test.Prelude -import qualified Hedgehog.Gen as Gen -import qualified Hedgehog.Range as Range -------------------------------------------------------------------------------- -import ${1:$(s-chop-suffix "Test" yas-text)} +import ${1:$(s-chop-suffix "Spec" yas-text)} -------------------------------------------------------------------------------- + +main :: IO () +main = defaultMain test + +test :: TestTree +test = testGroup "$1" + [ $0 + ] \ No newline at end of file |