-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed the tests to be more descriptive.
- Loading branch information
Showing
236 changed files
with
283 additions
and
88 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
test/Harper/Tests/Bad/CallingCurrentOnAnEmptyIteratorBeforeNext.har
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,7 @@ | ||
iterate :: Iterator Integer; | ||
iterate = { | ||
yield return; | ||
}; | ||
|
||
main :: Integer; | ||
main = iterate.current; |
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
test/Harper/Tests/Bad/CallingCurrentOnAnEmptyRefIteratorBeforeNext.har
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,8 @@ | ||
iterate :: RefIterator Integer sideeffect; | ||
iterate = { | ||
eval printLn "Empty." (); | ||
yield return; | ||
}; | ||
|
||
main :: sideeffect -> Integer; | ||
main = iterate.current (); |
3 changes: 3 additions & 0 deletions
3
test/Harper/Tests/Bad/CallingCurrentOnAnEmptyRefIteratorBeforeNext.out
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,3 @@ | ||
Error: iterator's `current` function called before `next` or the sequence had no elements. | ||
|
||
Execution terminated with an error: runtime error. |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
test/Harper/Tests/Bad/CallingCurrentOnAnIteratorBeforeNext.out
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,3 @@ | ||
Error: iterator's `current` function called before `next` or the sequence had no elements. | ||
|
||
Execution terminated with an error: runtime error. |
12 changes: 12 additions & 0 deletions
12
test/Harper/Tests/Bad/CallingCurrentOnAnRefIteratorBeforeNext.har
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,12 @@ | ||
iterate :: RefIterator Integer sideeffect; | ||
iterate = { | ||
var (i :: Integer) = 0; | ||
while true { | ||
yield i; | ||
eval printLn i (); | ||
i += 1; | ||
} | ||
}; | ||
|
||
main :: sideeffect -> Integer; | ||
main = iterate.current (); |
3 changes: 3 additions & 0 deletions
3
test/Harper/Tests/Bad/CallingCurrentOnAnRefIteratorBeforeNext.out
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,3 @@ | ||
Error: iterator's `current` function called before `next` or the sequence had no elements. | ||
|
||
Execution terminated with an error: runtime error. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
test/Harper/Tests/Bad/ConflictingVariantDeclarations_BetweenDifferentTypes.har
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,16 @@ | ||
value List a = { | ||
variant Empty = { }; | ||
}; | ||
|
||
value Bag a b c d = { | ||
variant Empty = { }; | ||
variant Bag = { | ||
data = { | ||
a :: a; a :: b; c :: c; c :: d; | ||
} | ||
}; | ||
}; | ||
|
||
|
||
main :: Integer; | ||
main = 42; |
25 changes: 25 additions & 0 deletions
25
test/Harper/Tests/Bad/ConflictingVariantDeclarations_BetweenDifferentTypes.out
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,25 @@ | ||
Error: conflicting type variant names `Empty`. | ||
Conflicting declarations: | ||
value List a = { | ||
variant Empty = { | ||
} ; | ||
} | ||
|
||
Located at line 1 column 1 | ||
value Bag a b c d = { | ||
variant Empty = { | ||
} ; | ||
variant Bag = { | ||
data = { | ||
a :: a ; | ||
a :: b ; | ||
c :: c ; | ||
c :: d ; | ||
} | ||
} ; | ||
} | ||
|
||
Located at line 5 column 1 | ||
|
||
|
||
Execution terminated with an error: type error. |
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
28 changes: 28 additions & 0 deletions
28
test/Harper/Tests/Bad/ConflictingVariantDeclarations_WithinOneType.har
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,28 @@ | ||
value List a = { | ||
variant Empty = { }; | ||
|
||
variant NonEmpty = { | ||
data = { | ||
head :: a; | ||
} | ||
}; | ||
|
||
variant NonEmpty = { | ||
data = { | ||
head :: a; | ||
tail :: List a; | ||
} | ||
}; | ||
}; | ||
|
||
value Bag a b c d = { | ||
variant Bag = { | ||
data = { | ||
a :: a; a :: b; c :: c; c :: d; | ||
} | ||
}; | ||
}; | ||
|
||
|
||
main :: Integer; | ||
main = 42; |
22 changes: 22 additions & 0 deletions
22
test/Harper/Tests/Bad/ConflictingVariantDeclarations_WithinOneType.out
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,22 @@ | ||
Error: conflicting type variant names `NonEmpty`. | ||
Conflicting declarations: | ||
value List a = { | ||
variant Empty = { | ||
} ; | ||
variant NonEmpty = { | ||
data = { | ||
head :: a ; | ||
} | ||
} ; | ||
variant NonEmpty = { | ||
data = { | ||
head :: a ; | ||
tail :: List a ; | ||
} | ||
} ; | ||
} | ||
|
||
Located at line 1 column 1 | ||
|
||
|
||
Execution terminated with an error: type error. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
test/Harper/Tests/Bad/DeclaredIdentifiersAreNotInScopeOnRightHandSideOfDeconstruction.har
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,12 @@ | ||
main :: sideeffect -> (); | ||
main = { | ||
// If lambdas could be recursive, i.e. `f` was visible in the body of the deconstructed lambda, | ||
// this code would have no sensible semantics, as `f` would be used during the evaluation | ||
// of the value being assigned to it. This restriction could theoretically be dropped if the rhs is pure. | ||
(f :: Integer -> Integer) = (\(x :: Integer) => { | ||
eval printLn (f 10) (); | ||
return (\(n :: Integer) => n * x); | ||
}) 42 (); | ||
|
||
eval printLn (f 10) (); | ||
}; |
2 changes: 1 addition & 1 deletion
2
test/Harper/Tests/Bad/issue019_lambdaSE2.out → ...nScopeOnRightHandSideOfDeconstruction.out
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Error: undeclared identifier `f`. | ||
During evaluation of: | ||
f | ||
Located at line 4 column 21 | ||
Located at line 7 column 21 | ||
|
||
Execution terminated with an error: type error. |
File renamed without changes.
File renamed without changes.
14 changes: 9 additions & 5 deletions
14
...od/issue016_ifElseDefiniteAssignment1.har → ...arper/Tests/Bad/DefiniteAssignment_If.har
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
2 changes: 1 addition & 1 deletion
2
...Tests/Bad/issue016_definiteAssignment.out → ...arper/Tests/Bad/DefiniteAssignment_If.out
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Error: variable `x` is not definitely assigned at point of use. | ||
During evaluation of: | ||
x | ||
Located at line 4 column 10 | ||
Located at line 16 column 13 | ||
|
||
Execution terminated with an error: type error. |
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,28 @@ | ||
f :: Integer -> Integer; | ||
f n = { | ||
var (x :: Integer); | ||
var (result :: Integer) = 0; | ||
|
||
if (n == 42) { | ||
x := n; | ||
|
||
// x is definitey assigned. | ||
|
||
result += x; | ||
} | ||
else if (n < 42) { | ||
x := 0; | ||
|
||
// x is definitely assigned. | ||
|
||
result += x; | ||
} | ||
|
||
// x is not definitely assigned. | ||
|
||
result += x + n; | ||
return result; | ||
}; | ||
|
||
main :: Integer; | ||
main = f 42; |
2 changes: 1 addition & 1 deletion
2
...d/issue016_ifElseIfDefiniteAssignment.out → ...Tests/Bad/DefiniteAssignment_IfElseIf.out
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Error: variable `x` is not definitely assigned at point of use. | ||
During evaluation of: | ||
x | ||
Located at line 12 column 25 | ||
Located at line 23 column 13 | ||
|
||
Execution terminated with an error: type error. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,10 @@ | ||
f :: Integer -> Integer; | ||
f n = { | ||
while 1 { | ||
return n; | ||
} | ||
return 0; | ||
}; | ||
|
||
main :: Integer; | ||
main = f 42; |
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 @@ | ||
Error: expression `1` of type `Integer` cannot be used as a predicate in a conditional. | ||
During evaluation of: | ||
while 1 { | ||
return n ; | ||
} | ||
|
||
Located at line 3 column 3 | ||
|
||
Execution terminated with an error: type error. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
test/Harper/Tests/Bad/issue016_ifElseIfDefiniteAssignment.har
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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,5 @@ | ||
fun :: Integer -> Bool; | ||
fun n = fun (n + 1); | ||
|
||
main :: Bool; | ||
main = false and (fun 42); |
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 @@ | ||
Execution ended with value: false |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.