From 19faa4a089fbea0798e1d9c533bdfc8c874341d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Dubiel?= Date: Thu, 19 Mar 2015 05:31:59 +0100 Subject: [PATCH] Fixing tests --- .../MultipleParameterListsFormatterTest.scala | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/MultipleParameterListsFormatterTest.scala b/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/MultipleParameterListsFormatterTest.scala index f408d004..a5cd30d1 100644 --- a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/MultipleParameterListsFormatterTest.scala +++ b/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/MultipleParameterListsFormatterTest.scala @@ -1,11 +1,19 @@ 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) @@ -13,14 +21,17 @@ class MultipleParameterListsFormatterTest extends AbstractExpressionFormatterTes """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 } @@ -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 }