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