Skip to content

Commit

Permalink
Add tests with binpack=oneline and multiline arg
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Jan 21, 2022
1 parent 3bba344 commit 6788356
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 0 deletions.
48 changes: 48 additions & 0 deletions scalafmt-tests/src/test/resources/newlines/source_classic.stat
Original file line number Diff line number Diff line change
Expand Up @@ -2705,6 +2705,54 @@ object a {
).foo
}
}
<<< binpack call, oneline, with syntaxNL, single arg
maxColumn = 60
binPack.unsafeCallSite = oneline
optIn.configStyleArguments = false
===
object a {
val readOut = new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin)
}
>>>
object a {
val readOut =
new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin)
}
<<< binpack call, oneline, with syntaxNL, multiple args
maxColumn = 60
binPack.unsafeCallSite = oneline
optIn.configStyleArguments = false
===
object a {
val readOut = new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin, "main.js.map" -> raw"""{
| "file": "main.js",
| "other key": 1
|}""".stripMargin)
}
>>>
object a {
val readOut =
new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin, "main.js.map" -> raw"""{
| "file": "main.js",
| "other key": 1
|}""".stripMargin)
}
<<< binPack with named parameter values, danglingParentheses
binPack.preset = true
optIn.configStyleArguments = false
Expand Down
48 changes: 48 additions & 0 deletions scalafmt-tests/src/test/resources/newlines/source_fold.stat
Original file line number Diff line number Diff line change
Expand Up @@ -2555,6 +2555,54 @@ object a {
).foo
}
}
<<< binpack call, oneline, with syntaxNL, single arg
maxColumn = 60
binPack.unsafeCallSite = oneline
optIn.configStyleArguments = false
===
object a {
val readOut = new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin)
}
>>>
object a {
val readOut =
new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin)
}
<<< binpack call, oneline, with syntaxNL, multiple args
maxColumn = 60
binPack.unsafeCallSite = oneline
optIn.configStyleArguments = false
===
object a {
val readOut = new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin, "main.js.map" -> raw"""{
| "file": "main.js",
| "other key": 1
|}""".stripMargin)
}
>>>
object a {
val readOut =
new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin, "main.js.map" -> raw"""{
| "file": "main.js",
| "other key": 1
|}""".stripMargin)
}
<<< binPack with named parameter values, danglingParentheses
binPack.preset = true
optIn.configStyleArguments = false
Expand Down
48 changes: 48 additions & 0 deletions scalafmt-tests/src/test/resources/newlines/source_keep.stat
Original file line number Diff line number Diff line change
Expand Up @@ -2710,6 +2710,54 @@ object a {
).foo
}
}
<<< binpack call, oneline, with syntaxNL, single arg
maxColumn = 60
binPack.unsafeCallSite = oneline
optIn.configStyleArguments = false
===
object a {
val readOut = new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin)
}
>>>
object a {
val readOut =
new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin)
}
<<< binpack call, oneline, with syntaxNL, multiple args
maxColumn = 60
binPack.unsafeCallSite = oneline
optIn.configStyleArguments = false
===
object a {
val readOut = new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin, "main.js.map" -> raw"""{
| "file": "main.js",
| "other key": 1
|}""".stripMargin)
}
>>>
object a {
val readOut =
new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin, "main.js.map" -> raw"""{
| "file": "main.js",
| "other key": 1
|}""".stripMargin)
}
<<< binPack with named parameter values, danglingParentheses
binPack.preset = true
optIn.configStyleArguments = false
Expand Down
48 changes: 48 additions & 0 deletions scalafmt-tests/src/test/resources/newlines/source_unfold.stat
Original file line number Diff line number Diff line change
Expand Up @@ -2869,6 +2869,54 @@ object a {
).foo
}
}
<<< binpack call, oneline, with syntaxNL, single arg
maxColumn = 60
binPack.unsafeCallSite = oneline
optIn.configStyleArguments = false
===
object a {
val readOut = new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin)
}
>>>
object a {
val readOut =
new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin)
}
<<< binpack call, oneline, with syntaxNL, multiple args
maxColumn = 60
binPack.unsafeCallSite = oneline
optIn.configStyleArguments = false
===
object a {
val readOut = new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin, "main.js.map" -> raw"""{
| "file": "main.js",
| "other key": 1
|}""".stripMargin)
}
>>>
object a {
val readOut =
new ReadOnlyOutputDirectory("main.js" -> raw"""
|console.log("hello");
|//# sourceMappingURL=main.js.map
|// some other comment
|""".stripMargin, "main.js.map" -> raw"""{
| "file": "main.js",
| "other key": 1
|}""".stripMargin)
}
<<< binPack with named parameter values, danglingParentheses
binPack.preset = true
optIn.configStyleArguments = false
Expand Down

0 comments on commit 6788356

Please sign in to comment.