From b2637edc236510bbb8d1c630e2348a00261c5094 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 13 Jun 2021 23:11:14 -0400 Subject: feat(gs/emacs): Revamp haskell test-mode snippet 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 Tested-by: BuildkiteCI --- users/grfn/emacs.d/snippets/haskell-mode/test-module | 15 ++++++++++----- 1 file 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 82224b36a4..036b0ae998 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 -- cgit 1.4.1