@@ -16,7 +16,7 @@ class OsSpecificFrontendSpec extends AnyFlatSpec with Matchers {
16
16
generator : ProtocCodeGenerator ,
17
17
env : ExtraEnv ,
18
18
request : Array [Byte ]
19
- ): Array [Byte ] = {
19
+ ): (frontend. InternalState , Array [Byte ]) = {
20
20
val (path, state) = frontend.prepare(
21
21
generator,
22
22
env
@@ -40,10 +40,10 @@ class OsSpecificFrontendSpec extends AnyFlatSpec with Matchers {
40
40
}, _.close()))
41
41
process.exitValue()
42
42
frontend.cleanup(state)
43
- actualOutput.toByteArray
43
+ (state, actualOutput.toByteArray)
44
44
}
45
45
46
- protected def testSuccess (frontend : PluginFrontend ): Unit = {
46
+ protected def testSuccess (frontend : PluginFrontend ): frontend. InternalState = {
47
47
val random = new Random ()
48
48
val toSend = Array .fill(123 )(random.nextInt(256 ).toByte)
49
49
val toReceive = Array .fill(456 )(random.nextInt(256 ).toByte)
@@ -55,11 +55,12 @@ class OsSpecificFrontendSpec extends AnyFlatSpec with Matchers {
55
55
toReceive
56
56
}
57
57
}
58
- val response = testPluginFrontend(frontend, fakeGenerator, env, toSend)
58
+ val (state, response) = testPluginFrontend(frontend, fakeGenerator, env, toSend)
59
59
response mustBe toReceive
60
+ state
60
61
}
61
62
62
- protected def testFailure (frontend : PluginFrontend ): Unit = {
63
+ protected def testFailure (frontend : PluginFrontend ): frontend. InternalState = {
63
64
val random = new Random ()
64
65
val toSend = Array .fill(123 )(random.nextInt(256 ).toByte)
65
66
val env = new ExtraEnv (secondaryOutputDir = " tmp" )
@@ -69,7 +70,8 @@ class OsSpecificFrontendSpec extends AnyFlatSpec with Matchers {
69
70
throw new OutOfMemoryError (" test error" )
70
71
}
71
72
}
72
- val response = testPluginFrontend(frontend, fakeGenerator, env, toSend)
73
+ val (state, response) = testPluginFrontend(frontend, fakeGenerator, env, toSend)
73
74
response.length must be > 0
75
+ state
74
76
}
75
77
}
0 commit comments