Skip to content

Commit 0c7a9e6

Browse files
reid-spencerclaude
andcommitted
Fix CommandTest to not hardcode severity values
Use Messages.SevereError.severity + 1 instead of literal 6 for the expected exit code, so the test adapts to severity renumbering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 13f619e commit 0c7a9e6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

commands/shared/src/test/scala/com/ossuminc/riddl/commands/CommandTest.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package com.ossuminc.riddl.commands
88

99
/** Unit Tests For Running Riddlc Commands from Plugins */
1010

11+
import com.ossuminc.riddl.language.Messages
1112
import com.ossuminc.riddl.utils.{AbstractTestingBasis, ec, pc}
1213
import org.ekrich.config.*
1314
import scopt.*
@@ -64,7 +65,7 @@ class CommandTest extends AbstractTestingBasis {
6465
"hugo"
6566
)
6667
val rc = Commands.runMain(args)
67-
rc must be(6)
68+
rc must be(Messages.Error.severity + 1)
6869
}
6970

7071
"handle wrong command as target" in {
@@ -77,7 +78,7 @@ class CommandTest extends AbstractTestingBasis {
7778
"flumox" // unknown command
7879
)
7980
val rc = Commands.runMain(args)
80-
rc must be(6)
81+
rc must be(Messages.Error.severity + 1)
8182
}
8283
}
8384
}

0 commit comments

Comments
 (0)