Skip to content

Commit

Permalink
Add MessagesPassTest
Browse files Browse the repository at this point in the history
Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
  • Loading branch information
reid-spencer committed Oct 22, 2023
1 parent 95f0a1b commit f71004d
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.reactific.riddl.hugo

import com.reactific.riddl.passes.Pass
import com.reactific.riddl.testkit.ValidatingTest

class MessagesPassTest extends ValidatingTest {

val dir = "testkit/src/test/input/"

"MessagesPass" must {
"generate MessageInfo" in {
parseAndValidateTestInput("ToDoItem", "everything.riddl", dir) { case (root, pr) =>
if pr.messages.hasErrors then
val errors = pr.messages.justErrors.format
fail(errors)
else
val pass = new MessagesPass(pr.input, pr.outputs, HugoCommand.Options())
val output: MessageOutput = Pass.runPass[MessageOutput](pr.input, pr.outputs, pass)
output.collected.size must be(6)
}
}
}
}

0 comments on commit f71004d

Please sign in to comment.