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