Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Dubiel committed Mar 19, 2015
1 parent ebedc0f commit 19faa4a
Showing 1 changed file with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
package com.danieltrinh.scalariform.formatter

import com.danieltrinh.scalariform.formatter.preferences.{BreakMultipleParameterGroups, FormattingPreferences}
import com.danieltrinh.scalariform.parser.{CompilationUnit, FullDefOrDcl, ScalaParser}

class MultipleParameterListsFormatterTest extends AbstractExpressionFormatterTest {
class MultipleParameterListsFormatterTest extends AbstractFormatterTest {

override def debug = false

def parse(parser: ScalaParser) = parser.compilationUnitOrScript()

type Result = CompilationUnit

def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState(indentLevel = 0))


{

implicit val formatting = FormattingPreferences.setPreference(BreakMultipleParameterGroups, true)

"""def f(x: Int)
|(y: Int): Int = {
|}
|""" ==> """def f(x: Int)(y: Int): Int = {
|""".stripMargin ==>
"""def f(x: Int)(y: Int): Int = {
|}
|"""
|""".stripMargin
"""def f(x: Int)
| (y: Int)(z: Int): Int = {
|}""" ==>"""def f(x: Int)(y: Int)(z: Int): Int = {
|}
|"""
|}
|""".stripMargin ==>
"""def f(x: Int)(y: Int)(z: Int): Int = {
|}
|""".stripMargin

}

Expand All @@ -31,28 +42,30 @@ class MultipleParameterListsFormatterTest extends AbstractExpressionFormatterTes

"""def f(x: Int)(y: Int): Int = {
|}
|""" ==>
|""".stripMargin ==>
"""def f(x: Int)
| (y: Int): Int = {
|}
|"""
|""".stripMargin

"""def f(x: Int)
| (y: Int)(z: Int): Int = {
|}
""" ==>
""".stripMargin ==>
"""def f(x: Int)
| (y: Int)
| (z: Int): Int = {
|}
|""" // See issue #73
|""".stripMargin

// See issue #73
"""def mergeMapsCombiningValueMaps[A, B, C](collisionFunc: (C, C) => C)(m1: Map[A, Map[Seq[B], C]], m2: Map[A, Map[Seq[B], C]]): Map[A, Map[Seq[B], C]] = {
| mergeMaps(m1, m2)((m11, m22) => mergeMaps(m11, m22)(collisionFunc))
|}""" ==>
|}""".stripMargin ==>
"""def mergeMapsCombiningValueMaps[A, B, C](collisionFunc: (C, C) => C)
| (m1: Map[A, Map[Seq[B], C]], m2: Map[A, Map[Seq[B], C]]): Map[A, Map[Seq[B], C]] = {
| mergeMaps(m1, m2)((m11, m22) => mergeMaps(m11, m22)(collisionFunc))
|}"""
|}""".stripMargin

}

Expand Down

0 comments on commit 19faa4a

Please sign in to comment.