Skip to content

Commit

Permalink
Add tests for issues #7269, #7270, #7271 with dummy error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed May 16, 2024
1 parent 084c8f9 commit 4c50992
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/Fail/TypeBasedTermination/Issue7269.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Andreas, 2024-05-16, issue #7269
-- --no-syntax-based-termination should not turn on --type-based-termination

{-# OPTIONS --no-type-based-termination #-}
{-# OPTIONS --no-syntax-based-termination #-} -- Turns on TBT, but should not

record U : Set where
coinductive
field force : U
open U

-- This should not pass since no termination checker is on.
u : U
u .force = u
1 change: 1 addition & 0 deletions test/Fail/TypeBasedTermination/Issue7269.err
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AGDA_FAIL
21 changes: 21 additions & 0 deletions test/Fail/TypeBasedTermination/Issue7270.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- Andreas, 2024-05-16, issue #7270

{-# OPTIONS --type-based-termination #-}

record U : Set where
coinductive
field force : U
open U

postulate d : U U

-- f is classified as size preserving, but is not, since d is unknown
-- Counterexamples: d = id; d u = u .force
--
f : U U
f u = d u .force

-- This should not pass:
--
u : U
u .force = f u
1 change: 1 addition & 0 deletions test/Fail/TypeBasedTermination/Issue7270.err
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AGDA_FAIL
32 changes: 32 additions & 0 deletions test/Fail/TypeBasedTermination/Issue7271.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- Andreas, 2024-05-16, issue #7271.
-- Bug in size-preservation checker.

{-# OPTIONS --type-based-termination #-}

data : Set where

record _×_ (A B : Set) : Set where
field
fst : A
snd : B
open _×_

-- Empty stream type.
--
record S : Set where
coinductive; constructor delay
field force : ⊥ × S
open S

-- This is not size-preserving:
--
f : S ⊥ × S
f s = s' .force where s' = s

-- This should not be accepted:
--
s : S
s .force = f s

absurd :
absurd = s .force .fst
1 change: 1 addition & 0 deletions test/Fail/TypeBasedTermination/Issue7271.err
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AGDA_FAIL
33 changes: 33 additions & 0 deletions test/Fail/TypeBasedTermination/Issue7271With.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Andreas, 2024-05-16, issue #7271.
-- Bug in size-preservation checker.

{-# OPTIONS --type-based-termination #-}

data : Set where

record _×_ (A B : Set) : Set where
field
fst : A
snd : B
open _×_

-- Empty stream type.
--
record S : Set where
coinductive; constructor delay
field force : ⊥ × S
open S

-- This is not size-preserving:
--
f : S ⊥ × S
f s with s
... | s' = s' .force

-- This should not be accepted:
--
s : S
s .force = f s

absurd :
absurd = s .force .fst
1 change: 1 addition & 0 deletions test/Fail/TypeBasedTermination/Issue7271With.err
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AGDA_FAIL

0 comments on commit 4c50992

Please sign in to comment.