aboutsummaryrefslogtreecommitdiff
path: root/src/test/groovy
diff options
context:
space:
mode:
authormodmuss50 <modmuss50@gmail.com>2021-10-24 14:11:01 +0100
committerGitHub <noreply@github.com>2021-10-24 14:11:01 +0100
commit61b5cfa733559b2c631bd25eec1b89e63ba76620 (patch)
treee8d2bc3cd1caede5a3367044b1c1ced1e48a33d5 /src/test/groovy
parent7359dc4e98c2f33b8ebc199c1aea3c2482a1c7f7 (diff)
downloadarchitectury-loom-61b5cfa733559b2c631bd25eec1b89e63ba76620.tar.gz
architectury-loom-61b5cfa733559b2c631bd25eec1b89e63ba76620.tar.bz2
architectury-loom-61b5cfa733559b2c631bd25eec1b89e63ba76620.zip
Improve run config argument handling, should work with spaces a bit better. (#524)
Diffstat (limited to 'src/test/groovy')
-rw-r--r--src/test/groovy/net/fabricmc/loom/test/integration/RunConfigTest.groovy1
-rw-r--r--src/test/groovy/net/fabricmc/loom/test/unit/RunConfigUnitTest.groovy38
2 files changed, 39 insertions, 0 deletions
diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/RunConfigTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/RunConfigTest.groovy
index e893c352..46d8b3a3 100644
--- a/src/test/groovy/net/fabricmc/loom/test/integration/RunConfigTest.groovy
+++ b/src/test/groovy/net/fabricmc/loom/test/integration/RunConfigTest.groovy
@@ -42,6 +42,7 @@ class RunConfigTest extends Specification implements GradleProjectTestTrait {
then:
result.task(":${task}").outcome == SUCCESS
+ result.output.contains("This contains a space")
where:
task | _
diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/RunConfigUnitTest.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/RunConfigUnitTest.groovy
new file mode 100644
index 00000000..8a804d71
--- /dev/null
+++ b/src/test/groovy/net/fabricmc/loom/test/unit/RunConfigUnitTest.groovy
@@ -0,0 +1,38 @@
+/*
+ * This file is part of fabric-loom, licensed under the MIT License (MIT).
+ *
+ * Copyright (c) 2021 FabricMC
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package net.fabricmc.loom.test.unit
+
+import net.fabricmc.loom.configuration.ide.RunConfig
+import spock.lang.Specification
+
+class RunConfigUnitTest extends Specification {
+ def "escape arguments"() {
+ when:
+ def args = RunConfig.joinArguments(["-Dfabric.test=123", "-Dfabric.test=abc 123"])
+
+ then:
+ args == '"-Dfabric.test=123" "-Dfabric.test=abc 123"'
+ }
+}