diff options
Diffstat (limited to 'testsuite/tests/ghci.debugger/scripts')
-rw-r--r-- | testsuite/tests/ghci.debugger/scripts/T19157.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/ghci.debugger/scripts/T19157.script | 20 | ||||
-rw-r--r-- | testsuite/tests/ghci.debugger/scripts/T19157.stdout | 41 | ||||
-rw-r--r-- | testsuite/tests/ghci.debugger/scripts/all.T | 1 |
4 files changed, 70 insertions, 0 deletions
diff --git a/testsuite/tests/ghci.debugger/scripts/T19157.hs b/testsuite/tests/ghci.debugger/scripts/T19157.hs new file mode 100644 index 0000000000..d844a31e7e --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/T19157.hs @@ -0,0 +1,8 @@ +module T19157 where + +mySum :: [Int] -> Int +mySum lst = go 0 lst + where + go :: Int -> [Int] -> Int + go sum [] = sum + go sum (s : ss) = go (sum + s) ss diff --git a/testsuite/tests/ghci.debugger/scripts/T19157.script b/testsuite/tests/ghci.debugger/scripts/T19157.script new file mode 100644 index 0000000000..edcad557d5 --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/T19157.script @@ -0,0 +1,20 @@ +:l T19157 +:break mySum.go +putStrLn "---------------------- Test 1" +mySum [1,2,3,4,5,6] +:cont 2 +:cont 1 +:cont +:cont +putStrLn "---------------------- Test 2" +:ig 1 1000 +mySum [1..2000] +putStrLn "---------------------- Test 3" +:continue q +:continue -1 +:cont 3 4 +:ig a 5 +:ignore 5 a +:ignore 0 +:ignore 1 2 3 4 +:ignore 0 -1 diff --git a/testsuite/tests/ghci.debugger/scripts/T19157.stdout b/testsuite/tests/ghci.debugger/scripts/T19157.stdout new file mode 100644 index 0000000000..f0ac09d7f4 --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/T19157.stdout @@ -0,0 +1,41 @@ +Breakpoint 0 activated at T19157.hs:7:17-19 +Breakpoint 1 activated at T19157.hs:8:23-37 +---------------------- Test 1 +Stopped in T19157.mySum.go, T19157.hs:8:23-37 +_result :: Int = _ +go :: Int -> [Int] -> Int = _ +s :: Int = 1 +ss :: [Int] = [2,3,4,5,6] +sum :: Int = 0 +Stopped in T19157.mySum.go, T19157.hs:8:23-37 +_result :: Int = _ +go :: Int -> [Int] -> Int = _ +s :: Int = 4 +ss :: [Int] = [5,6] +sum :: Int = _ +Stopped in T19157.mySum.go, T19157.hs:8:23-37 +_result :: Int = _ +go :: Int -> [Int] -> Int = _ +s :: Int = 6 +ss :: [Int] = [] +sum :: Int = _ +Stopped in T19157.mySum.go, T19157.hs:7:17-19 +_result :: Int = _ +sum :: Int = _ +21 +---------------------- Test 2 +Stopped in T19157.mySum.go, T19157.hs:8:23-37 +_result :: Int = _ +go :: Int -> [Int] -> Int = _ +s :: Int = 1001 +ss :: [Int] = _ +sum :: Int = _ +---------------------- Test 3 +Ignore count ‘q’ is not numeric +Ignore count ‘-1’ must be >= 0 +After ':continue' only one ignore count is allowed +Breakpoint a not found +Breakpoint 5 not found +Syntax: :ignore <breaknum> <count> +Syntax: :ignore <breaknum> <count> +Ignore count ‘-1’ must be >= 0 diff --git a/testsuite/tests/ghci.debugger/scripts/all.T b/testsuite/tests/ghci.debugger/scripts/all.T index 30e5c4312c..489fa89d36 100644 --- a/testsuite/tests/ghci.debugger/scripts/all.T +++ b/testsuite/tests/ghci.debugger/scripts/all.T @@ -125,3 +125,4 @@ test('T16700', normal, ghci_script, ['T16700.script']) test('break029', extra_files(['break029.hs']), ghci_script, ['break029.script']) test('T2215', normal, ghci_script, ['T2215.script']) test('T17989', normal, ghci_script, ['T17989.script']) +test('T19157', normal, ghci_script, ['T19157.script']) |