Skip to content

Commit ef401fc

Browse files
committed
Add another test case
1 parent 83ce2a8 commit ef401fc

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tests/src/test/scala/runtime/actionContainers/ActionProxyContainerTests.scala

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
271271
}
272272
}
273273

274-
it should "support array result" in {
274+
it should "support return array result" in {
275275
withActionContainer() { c =>
276276
val code = """
277277
|#!/bin/bash
@@ -281,7 +281,24 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
281281
val (initCode, initRes) = c.init(initPayload(code))
282282
initCode should be(200)
283283

284-
val (runCode, runRes) = c.runForJsArray(JsObject())
284+
val (runCode, runRes) = c.runForJsArray(runPayload(JsObject()))
285+
runCode should be(200)
286+
runRes shouldBe Some(JsArray(JsString("a"), JsString("b")))
287+
}
288+
}
289+
290+
it should "support array as input param" in {
291+
withActionContainer() { c =>
292+
val code = """
293+
|#!/bin/bash
294+
|arr=$1
295+
|echo $arr
296+
""".stripMargin.trim
297+
298+
val (initCode, initRes) = c.init(initPayload(code))
299+
initCode should be(200)
300+
301+
val (runCode, runRes) = c.runForJsArray(runPayload(JsArray(JsString("a"), JsString("b"))))
285302
runCode should be(200)
286303
runRes shouldBe Some(JsArray(JsString("a"), JsString("b")))
287304
}

0 commit comments

Comments
 (0)