-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ derive ] Support searching for very external generators
- Loading branch information
Showing
28 changed files
with
212 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/gen-derivation/derivation/core/norec nodep w_hnt 001/DerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module DerivedGen | ||
|
||
import RunDerivedGen | ||
|
||
%default total | ||
|
||
%language ElabReflection | ||
|
||
data X = MkX String String | ||
|
||
%runElab derive "X" [Generic, Meta, Show] | ||
|
||
%hint | ||
hintedStringGen : Fuel -> Gen String | ||
hintedStringGen _ = elements ["very-external", "hinted"] | ||
|
||
-- shall not use hinted strings gen, shall use the given one | ||
export | ||
checkedGen : Fuel -> (Fuel -> Gen String) => Gen X | ||
checkedGen = deriveGen | ||
|
||
main : IO () | ||
main = runGs [ G $ \fl => checkedGen fl @{smallStrs} ] |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 001/RunDerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/RunDerivedGen.idr |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 001/depends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/depends/ |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 001/derive.ipkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/derive.ipkg |
24 changes: 24 additions & 0 deletions
24
tests/gen-derivation/derivation/core/norec nodep w_hnt 001/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Generated values: | ||
----- | ||
----- | ||
MkX "a" "" | ||
----- | ||
MkX "" "" | ||
----- | ||
MkX "" "a" | ||
----- | ||
MkX "a" "a" | ||
----- | ||
MkX "" "a" | ||
----- | ||
MkX "a" "bc" | ||
----- | ||
MkX "" "" | ||
----- | ||
MkX "bc" "a" | ||
----- | ||
MkX "a" "a" | ||
----- | ||
MkX "a" "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/run |
23 changes: 23 additions & 0 deletions
23
tests/gen-derivation/derivation/core/norec nodep w_hnt 002/DerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module DerivedGen | ||
|
||
import RunDerivedGen | ||
|
||
%default total | ||
|
||
%language ElabReflection | ||
|
||
data X = MkX String String | ||
|
||
%runElab derive "X" [Generic, Meta, Show] | ||
|
||
%hint | ||
hintedStringGen : Fuel -> Gen String | ||
hintedStringGen _ = elements ["very-external", "hinted"] | ||
|
||
-- shall use the hinted strings gen | ||
export | ||
checkedGen : Fuel -> Gen X | ||
checkedGen = deriveGen | ||
|
||
main : IO () | ||
main = runGs [ G $ \fl => checkedGen fl ] |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 002/RunDerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/RunDerivedGen.idr |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 002/depends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/depends/ |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 002/derive.ipkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/derive.ipkg |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 002/dont-run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/run |
9 changes: 9 additions & 0 deletions
9
tests/gen-derivation/derivation/core/norec nodep w_hnt 002/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: While processing right hand side of $resolved16321,<DerivedGen.X>[]. While processing right hand side of $resolved16321,<DerivedGen.X>[],<<DerivedGen.MkX>>. Name Test.DepTyCheck.Gen.Uniform is private. | ||
|
||
Suggestion: add an explicit export or public export modifier. By default, all names are private in namespace blocks. | ||
Error: While processing right hand side of checkedGen. Error during reflection: While processing right hand side of $resolved16321,<DerivedGen.X>[]. While processing right hand side of $resolved16321,<DerivedGen.X>[],<<DerivedGen.MkX>>. Name Test.DepTyCheck.Gen.Uniform is private. | ||
|
||
Suggestion: add an explicit export or public export modifier. By default, all names are private in namespace blocks. | ||
Warning: compiling hole DerivedGen.checkedGen |
19 changes: 19 additions & 0 deletions
19
tests/gen-derivation/derivation/core/norec nodep w_hnt 003/DerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module DerivedGen | ||
|
||
import RunDerivedGen | ||
|
||
%default total | ||
|
||
%language ElabReflection | ||
|
||
data X = MkX (SomeTestType 2) (SomeTestType 3) | ||
|
||
%runElab derive "X" [Generic, Meta, Show] | ||
|
||
-- shall not use hinted strings gen, shall use the given one | ||
export | ||
checkedGen : Fuel -> (Fuel -> (n : Nat) -> Gen $ SomeTestType n) => Gen X | ||
checkedGen = deriveGen | ||
|
||
main : IO () | ||
main = runGs [ G $ \fl => checkedGen fl @{TunableSomeTestTypeGen "given"} ] |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 003/RunDerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/RunDerivedGen.idr |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 003/depends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/depends/ |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 003/derive.ipkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/derive.ipkg |
24 changes: 24 additions & 0 deletions
24
tests/gen-derivation/derivation/core/norec nodep w_hnt 003/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Generated values: | ||
----- | ||
----- | ||
MkX MkSomeTestType "given" [10, 0] MkSomeTestType "given" [0, 0, 0] | ||
----- | ||
MkX MkSomeTestType "given" [10, 10] MkSomeTestType "given" [10, 10, 10] | ||
----- | ||
MkX MkSomeTestType "given" [0, 10] MkSomeTestType "given" [10, 0, 0] | ||
----- | ||
MkX MkSomeTestType "given" [10, 0] MkSomeTestType "given" [0, 10, 10] | ||
----- | ||
MkX MkSomeTestType "given" [10, 10] MkSomeTestType "given" [10, 0, 0] | ||
----- | ||
MkX MkSomeTestType "given" [0, 10] MkSomeTestType "given" [10, 10, 0] | ||
----- | ||
MkX MkSomeTestType "given" [0, 0] MkSomeTestType "given" [10, 0, 10] | ||
----- | ||
MkX MkSomeTestType "given" [10, 10] MkSomeTestType "given" [10, 0, 10] | ||
----- | ||
MkX MkSomeTestType "given" [0, 10] MkSomeTestType "given" [10, 10, 10] | ||
----- | ||
MkX MkSomeTestType "given" [10, 0] MkSomeTestType "given" [10, 0, 0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/run |
19 changes: 19 additions & 0 deletions
19
tests/gen-derivation/derivation/core/norec nodep w_hnt 004/DerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module DerivedGen | ||
|
||
import RunDerivedGen | ||
|
||
%default total | ||
|
||
%language ElabReflection | ||
|
||
data X = MkX (SomeTestType 2) (SomeTestType 3) | ||
|
||
%runElab derive "X" [Generic, Meta, Show] | ||
|
||
-- shall not use hinted strings gen, shall use the given one | ||
export | ||
checkedGen : Fuel -> Gen X | ||
checkedGen = deriveGen | ||
|
||
main : IO () | ||
main = runGs [ G $ \fl => checkedGen fl ] |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 004/RunDerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/RunDerivedGen.idr |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 004/depends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/depends/ |
1 change: 1 addition & 0 deletions
1
tests/gen-derivation/derivation/core/norec nodep w_hnt 004/derive.ipkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/derive.ipkg |
24 changes: 24 additions & 0 deletions
24
tests/gen-derivation/derivation/core/norec nodep w_hnt 004/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Generated values: | ||
----- | ||
----- | ||
MkX MkSomeTestType "very-external" [10, 0] MkSomeTestType "very-external" [0, 0, 0] | ||
----- | ||
MkX MkSomeTestType "very-external" [10, 10] MkSomeTestType "very-external" [10, 10, 10] | ||
----- | ||
MkX MkSomeTestType "very-external" [0, 10] MkSomeTestType "very-external" [10, 0, 0] | ||
----- | ||
MkX MkSomeTestType "very-external" [10, 0] MkSomeTestType "very-external" [0, 10, 10] | ||
----- | ||
MkX MkSomeTestType "very-external" [10, 10] MkSomeTestType "very-external" [10, 0, 0] | ||
----- | ||
MkX MkSomeTestType "very-external" [0, 10] MkSomeTestType "very-external" [10, 10, 0] | ||
----- | ||
MkX MkSomeTestType "very-external" [0, 0] MkSomeTestType "very-external" [10, 0, 10] | ||
----- | ||
MkX MkSomeTestType "very-external" [10, 10] MkSomeTestType "very-external" [10, 0, 10] | ||
----- | ||
MkX MkSomeTestType "very-external" [0, 10] MkSomeTestType "very-external" [10, 10, 10] | ||
----- | ||
MkX MkSomeTestType "very-external" [10, 0] MkSomeTestType "very-external" [10, 0, 0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/run |