@@ -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
@@ -33,10 +33,10 @@ class OsSpecificFrontendSpec extends AnyFlatSpec with Matchers {
33
33
}, _.close()))
34
34
process.exitValue()
35
35
frontend.cleanup(state)
36
- actualOutput.toByteArray
36
+ (state, actualOutput.toByteArray)
37
37
}
38
38
39
- protected def testSuccess (frontend : PluginFrontend ): Unit = {
39
+ protected def testSuccess (frontend : PluginFrontend ): frontend. InternalState = {
40
40
val random = new Random ()
41
41
val toSend = Array .fill(123 )(random.nextInt(256 ).toByte)
42
42
val toReceive = Array .fill(456 )(random.nextInt(256 ).toByte)
@@ -48,11 +48,12 @@ class OsSpecificFrontendSpec extends AnyFlatSpec with Matchers {
48
48
toReceive
49
49
}
50
50
}
51
- val response = testPluginFrontend(frontend, fakeGenerator, env, toSend)
51
+ val (state, response) = testPluginFrontend(frontend, fakeGenerator, env, toSend)
52
52
response mustBe toReceive
53
+ state
53
54
}
54
55
55
- protected def testFailure (frontend : PluginFrontend ): Unit = {
56
+ protected def testFailure (frontend : PluginFrontend ): frontend. InternalState = {
56
57
val random = new Random ()
57
58
val toSend = Array .fill(123 )(random.nextInt(256 ).toByte)
58
59
val env = new ExtraEnv (secondaryOutputDir = " tmp" )
@@ -62,7 +63,8 @@ class OsSpecificFrontendSpec extends AnyFlatSpec with Matchers {
62
63
throw new OutOfMemoryError (" test error" )
63
64
}
64
65
}
65
- val response = testPluginFrontend(frontend, fakeGenerator, env, toSend)
66
+ val (state, response) = testPluginFrontend(frontend, fakeGenerator, env, toSend)
66
67
response.length must be > 0
68
+ state
67
69
}
68
70
}
0 commit comments