mirror of
https://github.com/larksuite/cli.git
synced 2026-09-14 18:42:53 +08:00
22 lines
478 B
Go
22 lines
478 B
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package report
|
|
|
|
import "testing"
|
|
|
|
func TestExitCodeRejectOnly(t *testing.T) {
|
|
ds := []Diagnostic{
|
|
{Action: ActionWarning},
|
|
{Action: ActionLabel},
|
|
}
|
|
if got := ExitCode(ds); got != 0 {
|
|
t.Fatalf("warnings and labels should not fail, got %d", got)
|
|
}
|
|
|
|
ds = append(ds, Diagnostic{Action: ActionReject})
|
|
if got := ExitCode(ds); got != 1 {
|
|
t.Fatalf("reject should fail, got %d", got)
|
|
}
|
|
}
|