diff options
Diffstat (limited to 'contrib/scalapblib/test/src/TutorialTests.scala')
-rw-r--r-- | contrib/scalapblib/test/src/TutorialTests.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/scalapblib/test/src/TutorialTests.scala b/contrib/scalapblib/test/src/TutorialTests.scala index fe0ce8d5..35ad69e0 100644 --- a/contrib/scalapblib/test/src/TutorialTests.scala +++ b/contrib/scalapblib/test/src/TutorialTests.scala @@ -24,6 +24,12 @@ object TutorialTests extends TestSuite { } } + object TutorialWithProtoc extends TutorialBase { + object core extends TutorialModule { + override def scalaPBProtocPath = Some("/dev/null") + } + } + val resourcePath: os.Path = os.pwd / 'contrib / 'scalapblib / 'test / 'protobuf / 'tutorial def protobufOutPath(eval: TestEvaluator): os.Path = @@ -108,5 +114,15 @@ object TutorialTests extends TestSuite { // assert(unchangedEvalCount == 0) // } } + + 'useExternalProtocCompiler - { + /* This ensure that the `scalaPBProtocPath` is properly used. + * As the given path is incorrect, the compilation should fail. + */ + 'calledWithWrongProtocFile - workspaceTest(TutorialWithProtoc) { eval => + val result = eval.apply(TutorialWithProtoc.core.compileScalaPB) + assert(result.isLeft) + } + } } } |