mirror of
https://github.com/larksuite/cli.git
synced 2026-09-14 18:42:53 +08:00
24 lines
816 B
Go
24 lines
816 B
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package platform
|
|
|
|
import "testing"
|
|
|
|
// These unkeyed literals intentionally model source published by consumers
|
|
// before distribution presentation existed. Adding a field to either exported
|
|
// struct makes this file fail to compile, catching that source break in CI.
|
|
var (
|
|
legacyCapabilitiesLiteral = Capabilities{"", false, FailOpen}
|
|
legacyRuleLiteral = Rule{"", "", nil, nil, RiskRead, nil, false}
|
|
)
|
|
|
|
func TestLegacyUnkeyedStructLiteralsRemainSourceCompatible(t *testing.T) {
|
|
if legacyCapabilitiesLiteral.FailurePolicy != FailOpen {
|
|
t.Errorf("legacy capabilities literal = %+v", legacyCapabilitiesLiteral)
|
|
}
|
|
if legacyRuleLiteral.MaxRisk != RiskRead {
|
|
t.Errorf("legacy rule literal = %+v", legacyRuleLiteral)
|
|
}
|
|
}
|