Skip to content

Commit 1c8f4e5

Browse files
committed
Add another test for #130
Unlike T130, T130b checks that we can indeed use version haskell-debugger-view 0.2.0.0 from hackage
1 parent f894f48 commit 1c8f4e5

6 files changed

Lines changed: 53 additions & 0 deletions

File tree

test/golden/T130b/T130b.cabal

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
cabal-version: 3.14
2+
name: T130b
3+
version: 0.1.0.0
4+
license: NONE
5+
author: Rodrigo Mesquita
6+
maintainer: rodrigo.m.mesquita@gmail.com
7+
build-type: Simple
8+
9+
common warnings
10+
ghc-options: -Wall
11+
12+
library
13+
import: warnings
14+
exposed-modules: Lib
15+
build-depends: base, haskell-debugger-view == 0.2.0.0
16+
hs-source-dirs: lib
17+
default-language: Haskell2010
18+
19+
executable T130b
20+
import: warnings
21+
main-is: Main.hs
22+
build-depends: base, T130b
23+
hs-source-dirs: app
24+
default-language: Haskell2010

test/golden/T130b/T130b.hdb-stdin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
run

test/golden/T130b/T130b.hdb-stdout

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[1 of 2] Compiling Main ( <TEMPORARY-DIRECTORY>]
2+
(hdb) MyType
3+
EvalCompleted {resultVal = "()", resultType = "()", resultStructureRef = NoVariables}
4+
(hdb) Exiting...

test/golden/T130b/T130b.hdb-test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
# the pkgdb is filled in by hie-bios
4+
# this test should succeed because we are using a supported
5+
# haskell-debugger-view (== 0.2.0.0), unlike for `T130`
6+
hdb -v0 app/Main.hs 2>&1 < T130b.hdb-stdin || true

test/golden/T130b/app/Main.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module Main (main) where
2+
3+
import Lib
4+
5+
main :: IO ()
6+
main = print my
7+

test/golden/T130b/lib/Lib.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{-# LANGUAGE DerivingVia, StandaloneDeriving #-}
2+
module Lib where
3+
4+
import GHC.Debugger.View.Class
5+
6+
data MyType = MyType deriving Show
7+
deriving via (BoringTy MyType) instance (DebugView MyType)
8+
9+
my :: MyType
10+
my = MyType
11+

0 commit comments

Comments
 (0)