1 package org.simantics.scl.compiler.tests;
4 import org.simantics.scl.compiler.top.ValueNotFound;
6 public class ModuleRegressionTests extends TestBase {
8 public ModuleRegressionTests() { super("scl"); }
10 @Test public void AmbiguousType() { test(); }
11 @Test public void ApplicationOfNunfunction() { test(); }
12 @Test public void Arity1() { test(); }
13 @Test public void AsPattern() { test(); }
14 @Test public void BigContext() { test(); }
15 @Test public void BigFunction() { test(); }
16 @Test public void BinaryOperators1() { test(); }
17 @Test public void BooleanId() { test(); }
18 @Test public void Bug4450() { test(); }
19 @Test public void Character1() { test(); }
20 @Test public void ClashingClass() { test(); }
21 @Test public void ClashingData() { test(); }
22 @Test public void ClashingInstance() { test(); }
23 @Test public void ClashingValueType() { test(); }
24 @Test public void ClosingBrace() { test(); }
25 @Test public void CHR1() { test(); }
26 @Test public void CHR2() { test(); }
27 @Test public void CHR3() { test(); }
28 @Test public void CHR4() { test(); }
29 @Test public void Collaz() { test(); }
30 @Test public void Compose() { test(); }
31 @Test public void Composition() { test(); }
32 @Test public void ConjunctionMacro() { test(); }
33 @Test public void Constant() { test(); }
34 @Test public void ConstructorNameClash() { test(); }
35 @Test public void DefaultMethods1() { test(); }
36 @Test public void Deriving3() { test(); }
37 @Test public void Deriving4() { test(); }
38 @Test public void DifferentBranchTypes() { test(); }
39 @Test public void Div() { test(); }
40 @Test public void DoubleConversion() { test(); }
41 @Test public void DoubleEffect() { test(); }
42 @Test public void Effects1() { test(); }
43 @Test public void Effects2() { test(); }
44 @Test public void Effects3() { test(); }
45 @Test public void Effects4() { test(); }
46 @Test public void Effects5() { test(); }
47 @Test public void Effects6() { test(); }
48 @Test public void EmptyLet() { test(); }
49 @Test(expected=ValueNotFound.class)
50 public void EmptyModule() throws ValueNotFound {
51 test(new String[]{"EmptyModule"}, new String[]{""});
53 @Test public void Equality() { test(); }
54 @Test public void ExistentialData() { test(); }
55 @Test public void ExistentialData2() { test(); }
56 @Test public void ExpressionParsing() { test(); }
57 @Test public void FaultyRecursion() { test(); }
58 @Test public void Fibonacci() { test(); }
59 @Test public void Fibonacci2() { test(); }
60 @Test public void Fibonacci3() { test(); }
61 @Test public void FingerTree() { test(); }
62 @Test public void FoldlBuild1() { test(); }
63 @Test public void FoldlBuild2() { test(); }
64 @Test public void FoldMissingInitialValue() { test(); }
65 @Test public void Forall1() { test(); }
66 @Test public void Forall2() { test(); }
67 @Test public void Forall3() { test(); }
68 @Test public void Formula() { test(); }
69 @Test public void FromDynamic() { test(); }
70 @Test public void FromDynamic2() { test(); }
71 @Test public void FromDynamic3() { test(); }
72 @Test public void FromDynamic4() { test(); }
73 @Test public void FromDynamic5() { test(); }
74 @Test public void FunctionFunctor() { test(); }
75 @Test public void Functor() { test(); }
76 @Test public void FunctorM1() { test(); }
77 @Test public void Generalization() { test(); }
78 @Test public void GenericMutualRecursion() { test(); }
79 @Test public void GlobalVariables() { test(); }
80 @Test public void GuardedExpressionBug() { test(); }
81 @Test public void Guards1() { test(); }
82 @Test public void Guards2() { test(); }
83 @Test public void IdAsOperator() { test(); }
84 //@Test public void IfWithoutElse() { test(); }
85 @Test public void IllegalChar() { test(); }
86 @Test public void ImportJavaConstructor() { test(); }
87 @Test public void ImportRef() { test(); }
88 @Test public void InconsistentArity() { test(); }
89 @Test public void InconsistentIndentation() { test(); }
90 @Test public void IndentationAndParenthesis() { test(); }
91 @Test public void Index() { test(); }
92 @Test public void Inline1() { test(); }
93 @Test public void InstanceHierarchy() { test(); }
94 @Test public void InstanceIsTypoedAsClass() { test(); }
95 @Test public void InvalidClass1() { test(); }
96 @Test public void InvalidEncoding() { test(); }
97 @Test public void InvalidInstance1() { test(); }
98 @Test public void InvalidJavaTypeAnnotation() { test(); }
99 @Test public void InvalidKinds() { test(); }
100 @Test public void InvalidKinds2() { test(); }
101 @Test public void InvalidKinds3() { test(); }
102 @Test public void InvalidLambda() { test(); }
103 @Test public void InvalidModule() { test(); }
104 @Test public void InvalidPattern1() { test(); }
105 @Test public void InvalidPattern2() { test(); }
106 @Test public void InvalidPattern3() { test(); }
107 @Test public void InvalidPattern4() { test(); }
108 @Test public void InvalidTypeClassInstance1() { test(); }
109 @Test public void JavaAccess1() { test(); }
110 @Test public void JavaConstructors() { test(); }
111 @Test public void JavaMethods() { test(); }
112 @Test public void JavaTypes() { test(); }
113 @Test public void Kinds1() { test(); }
114 @Test public void Lambda() { test(); }
115 @Test public void LambdaMatch() { test(); }
116 @Test public void Layout1() { test(); }
117 @Test public void List() { test(); }
118 @Test public void ListError1() { test(); }
119 @Test public void ListError2() { test(); }
120 @Test public void ListSyntax() { test(); }
121 @Test public void ListSyntax10() { test(); }
122 @Test public void ListSyntax11() { test(); }
123 @Test public void ListSyntax12() { test(); }
124 @Test public void ListSyntax2() { test(); }
125 @Test public void ListSyntax3() { test(); }
126 @Test public void ListSyntax4() { test(); }
127 @Test public void ListSyntax5() { test(); }
128 @Test public void ListSyntax6() { test(); }
129 @Test public void ListSyntax7() { test(); }
130 @Test public void ListSyntax8() { test(); }
131 @Test public void ListSyntax9() { test(); }
132 @Test public void ListSyntaxWithoutPrelude() { test(); }
133 @Test public void LocalDefinitions() { test(); }
134 @Test public void LocalDefinitions2() { test(); }
135 @Test public void LocalDefinitions3() { test(); }
136 @Test public void LocalDefinitions4() { test(); }
137 @Test public void LocalDefinitions5() { test(); }
138 @Test public void Macros1() { test(); }
139 @Test public void Macros2() { test(); }
140 @Test public void Macros4() { test(); }
141 @Test public void Map1() { test(); }
142 @Test public void MarketModel() { test(); }
143 @Test public void Matching() { test(); }
144 @Test public void Matching2() { test(); }
145 @Test public void Matching4() { test(); }
146 @Test public void Matching5() { test(); }
147 @Test public void MatchingWithMissingParameter() { test(); }
148 @Test public void MatchingWithoutTypeAnnotations() { test(); }
149 @Test public void MaximumBy() { test(); }
150 @Test public void Maybe1() { test(); }
151 @Test public void Maybe2() { test(); }
152 @Test public void Maybe3() { test(); }
153 @Test public void Maybe4() { test(); }
154 @Test public void MissingEffect() { test(); }
155 @Test public void MissingMethod() { test(); }
156 @Test public void ModuleInitialization() { test(); }
157 @Test public void MonadBug1() { test(); }
158 @Test public void Monads1() { test(); }
159 @Test public void MonadSyntax1() { test(); }
160 @Test public void NoDefinitionErrorMessage() { test(); }
161 @Test public void NoInstance() { test(); }
162 @Test public void NoInstance2() { test(); }
163 @Test public void NonassociativeOperator() { test(); }
164 @Test public void NonexistentTypeClassInAnnotation() { test(); }
165 @Test public void NonexistingEffect() { test(); }
166 @Test public void OneLineMatch() { test(); }
167 @Test public void OpenString1() { test(); }
168 @Test public void OpenString2() { test(); }
169 @Test public void OverloadedArithmetic1() { test(); }
170 @Test public void OverloadedArithmetic2() { test(); }
171 @Test public void OverloadedArithmetic3() { test(); }
172 @Test public void OverloadedLiterals2() { test(); }
173 @Test public void Overloading1() { test(); }
174 @Test public void Parsing() { test(); }
175 @Test public void PolymorphicRecursion() { test(); }
176 @Test public void PolymorphicRecursion2() { test(); }
177 @Test public void Polynomials() { test(); }
178 @Test public void PrecedenceOfNonoperators() { test(); }
179 @Test public void Primes() { test(); }
180 @Test public void Proc1() { test(); }
181 @Test public void Proc2() { test(); }
182 @Test public void Proc3() { test(); }
183 @Test public void Pythagoras() { test(); }
184 @Test public void Random1() { test(); }
185 @Test public void RangeSyntax() { test(); }
186 @Test public void Record1() { test(); }
187 @Test public void RecordShorthand() { test(); }
188 @Test public void RecursiveContext() { test(); }
189 @Test public void RecursiveValues2() { test(); }
190 @Test public void RecursiveValues3() { test(); }
191 @Test public void RecursiveValues4() { test(); }
192 @Test public void RedBlackTrees() { test(); }
193 @Test public void Relations1() { test(); }
194 @Test public void Relations2() { test(); }
195 @Test public void RepeatedVariableInPattern() { test(); }
196 @Test public void Scanl() { test(); }
197 @Test public void Search() { test(); }
198 @Test public void Sections() { test(); }
199 @Test public void Select1() { test(); }
200 @Test public void Select2() { test(); }
201 @Test public void Select3() { test(); }
202 @Test public void Select4() { test(); }
203 @Test public void Select5() { test(); }
204 @Test public void Select6() { test(); }
205 @Test public void Select7() { test(); }
206 @Test public void Select8() { test(); }
207 @Test public void Select9() { test(); }
208 @Test public void SelfReferringContextInTypeClass() { test(); }
209 @Test public void Serialization2() { test(); }
210 @Test public void Serialization3() { test(); }
211 @Test public void Serialization4() { test(); }
212 @Test public void SharedTypeVariable() { test(); }
213 @Test public void ShortcutFusion() { test(); }
214 @Test public void Show1() { test(); }
215 @Test public void SkipEqAndHashable() { test(); }
216 @Test public void SinConst1() { test(); }
217 @Test public void Sort() { test(); }
218 @Test public void Sort2() { test(); }
219 @Test public void SSATypingBug() { test(); }
220 @Test public void StreamFusion() { test(); }
221 @Test public void StringEscape() { test(); }
222 @Test public void StringInterpolation1() { test(); }
223 @Test public void StringInterpolation2() { test(); }
224 @Test public void StringInterpolation3() { test(); }
225 @Test public void StringMatching1() { test(); }
226 @Test public void SumOfInverses2() { test(); }
227 @Test public void TooManyParametersToSin() { test(); }
228 @Test public void Transformation1() { test(); }
229 @Test public void Transformation2() { test(); }
230 @Test public void Transformation3() { test(); }
231 @Test public void Transformation4() { test(); }
232 @Test public void Transformation5() { test(); }
233 @Test public void Transformation6() { test(); }
234 @Test public void Transformation7() { test(); }
235 @Test public void TransformationOrder() { test(); }
236 @Test public void Tuples() { test(); }
237 @Test public void Tuples2() { test(); }
238 @Test public void TypeAlias1() { test(); }
239 @Test public void TypeAlias2() { test(); }
240 @Test public void TypeAlias3() { test(); }
241 @Test public void TypeAliasRefsToTypeAlias() { test(); }
242 @Test public void TypeAnnotation1() { test(); }
243 @Test public void TypeAnnotation2() { test(); }
244 @Test public void TypeClass() { test(); }
245 @Test public void TypeClassBug1() { test(); }
246 @Test(timeout=1000L) public void TypeInferenceBug2() { test(); }
247 @Test public void TypeOf1() { test(); }
248 @Test public void TypingBug1() { test(); }
249 @Test public void TypingError1() { test(); }
250 @Test public void TypingError2() { test(); }
251 @Test public void UnaryMinus() { test(); }
252 @Test public void UndefinedValue() { test(); }
253 @Test public void UnexpectedToken() { test(); }
254 @Test public void Unification1() { test(); }
255 @Test public void UnknownAnnotation() { test(); }
256 @Test public void UnresolvedClass() { test(); }
257 @Test public void UnresolvedTypeInAnnotation() { test(); }
258 @Test public void UnresolvedTypeInInstance() { test(); }
259 @Test public void UnresolvedVariable() { test(); }
260 @Test public void UnresolvedVariable2() { test(); }
261 @Test public void ValueAsOperator() { test(); }
262 @Test public void ValueConversion() { test(); }
263 @Test public void Vector1() { test(); }
264 @Test public void Vector2() { test(); }
265 @Test public void ViewPatterns1() { test(); }
266 @Test public void Void1() { test(); }
267 @Test public void Void2() { test(); }
268 @Test public void Void3() { test(); }
269 @Test public void While() { test(); }
270 @Test public void While2() { test(); }
271 @Test public void While3() { test(); }
272 @Test public void WrongDefaultMethod() { test(); }
273 @Test public void WrongInstanceMethod() { test(); }
277 public static void checkCoverage() {
278 Failable<Module> maybeModule = PRELUDE_MODULE_REPOSITORY.getModule("Prelude");
279 if(!maybeModule.didSucceed())
281 Module module = maybeModule.getResult();
282 ModuleCoverage coverage = CoverageUtils.getCoverage(module);
285 coverage.print(System.out);
286 printCoverageTree(module.getBranchPoints().get("lookup"), 0);
289 private static void printCoverageTree(BranchPoint[] branchPoints, int ind) {
290 for(BranchPoint bp : branchPoints) {
291 for(int i=0;i<ind;++i)
292 System.out.print(" ");
293 System.out.println(bp.getCodeSize());
294 printCoverageTree(bp.getChildren(), ind+1);