summaryrefslogtreecommitdiff
path: root/test/junit
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2830 from densh/topic/stats-parsing-2Adriaan Moors2013-08-164-4/+121
|\ | | | | updated SI-7331, SI-6843, SI-7731, parser entry point refactoring, assertThrows utility function
| * addresses feedback regarding new junit testsDen Shabalin2013-08-154-21/+24
| | | | | | | | | | | | | | | | | | 1. don't recreate symbol table manually and just let JUnit do it automatically behind the scenes 2. minor changes to assertThrow's description 3. add one more test case to check that exception's subclasses are catched too 4. refine rethrow test to ensure that the exception wasn't swallowed
| * SI-7731 make CannotHaveAttrs more consistentDen Shabalin2013-08-141-0/+70
| | | | | | | | | | | | | | | | | | | | | | Previously setPos, pos_=, setType, tpe_= all behaved inconsistently between each other even though they all represent similar attributes that cannot be changed on CannotHaveAttrs trees. In order to simplify handling of such trees in compiler code each of these fields now supports assignment to its current default value: NoType for tpe and NoPosition for pos. Such assignments don't mutate underlying trees.
| * add assertThrows testing utility functionDen Shabalin2013-08-142-0/+44
| | | | | | | | This is much easier to use than built-in JUnit method-level checks.
* | Merge pull request #2819 from som-snytt/issue/regextract-charAdriaan Moors2013-08-141-0/+58
|\ \ | | | | | | SI-7737 Regex matches Char
| * | SI-7737 Regex matches CharSom Snytt2013-08-101-0/+58
| |/ | | | | | | | | | | | | | | | | | | | | Enables Char extraction by regex. ``` val r = """(\p{Lower})""".r "cat"(0) match { case r(x) => true } val nc = """\p{Lower}""".r "cat"(0) match { case nc() => true } ```
* | Merge pull request #2791 from som-snytt/issue/7265-2.11Adriaan Moors2013-08-141-0/+59
|\ \ | |/ |/| SI-7265 javaSpecVersion, adjust isJava... tests for 2.11
| * SI-7265 javaSpecVersion, adjust isJava... testsSom Snytt2013-08-011-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make this and related properties public, because they are useful. This change ought to have been committed at 2.11 and then backported with restrictions, rather than vice-versa. Note that they are defined in the order, version, vendor and name, which is the order from the underlying javadoc. It would be a neat feature of the PR validator, as previously imagined, to run a "pending" test and then, on success and merge, to move it automatically to the canonical suite.
* | Merge pull request #2776 from gkossakowski/symbolTable-refactoringsGrzegorz Kossakowski2013-08-062-0/+139
|\ \ | |/ |/| Refactor the cake so SymbolTable does not depend on Global
| * Add sample to SymbolTableTest using custom symbols and type.Grzegorz Kossakowski2013-08-021-0/+21
| | | | | | | | | | Add a test which demonstrates how one can create symbols and types from scratch and perform sub type check using them.
| * Address TODOs around SymbolLoaders and SymbolTable.Grzegorz Kossakowski2013-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SymbolTable refactoring introduced some TODOs that were supposed to be addressed after M5 release. The reason I couldn't address those problems right away was a conflict with our plans to modularize Scaladoc and interactive. However, we decided to delay that work until after M5 is released so addressing TODOs is not blocked anymore. This commit introduces the following changes: * Eclipse project definitions for interactive and scaladoc depend on scala-compiler project so they are builded against latest version of the compiler (quick) instead of STARR. This aligns our Eclipse project definitions with build.xml structure. * Introduce GlobalSymbolLoaders class which wires dependencies of SymbolLoaders with assumption of dependency on Global. * Switch to GlobalSymbolLoaders in BrowsingLoaders, interactive Global and ScaladocGlobal; this eliminates all TODO comments introduced before
| * Add example of SymbolTable unit test.Grzegorz Kossakowski2013-07-272-0/+118
| | | | | | | | | | | | | | Add a SymbolTableTest which contains all the code needed to initialize a SymbolTable in JUnit environment. It shows that initialization of definitions works and one can easily lookup some symbols and perform tests like subtyping tests.
* | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-07-291-0/+344
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/reify/phases/Reshape.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/transform/Mixin.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/StdAttachments.scala test/files/neg/macro-override-macro-overrides-abstract-method-b.check test/files/run/t7569.check
| * SI-7336 - Link flatMapped promises to avoid memory leaksRich Dougherty2013-07-061-0/+344
| |
* | SI-7614 Minimize the times of evaluation f in TraversableOnce.maxBy/minBy.yllan2013-07-061-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | In the previous implementation, maxBy/minBy will evaluate most of its elements with f twice to get the ordering. That results (2n - 2) evaluations of f. I save both the element and result of evaluation to a tuple so that it doesn't need to re-evaluate f on next comparison. Thus only n evaluations of f, that is the optimal. Note that the original implementation always returns the first matched if more than one element evaluated to same largest/smallest value of f. I document this behavior explicitly in this commit as well.
* | Move WeakHashSetTest to junit tests.Grzegorz Kossakowski2013-06-161-0/+171
|/ | | | | | The WeakHashSetTest was written as unit test but put into partest's `run` category as we were missing direct unit testing support. That got fixed so moving the test now.
* Add support for JUnit testsGrzegorz Kossakowski2013-06-151-0/+17
Add `test.junit` ant target that compiles and runs JUnit tests found in `test/junit` directory. Add `scala.tools.nsc.SampleTest` that demonstrates working testing infrastructure.