mirror of
https://github.com/gravitational/teleport.git
synced 2026-08-30 17:45:43 +08:00
91741f1abf
* Delete audit stream version check for v13 * Remove string parsing for bpf min kernel version * Remove string parsing for min etcd version * Remove version string parsing for route not found * Remove string parsing for min mariadb version * Remove string parsing for min mongodb custom data version * Remove string parsing for min openat2 kernel version * Use consts in api/version.go * Generate api/version.go with a go command * Avoid using a global variable SemVersion * Keep but deprecate SemVersion in api * fix-license
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
// Copyright 2025 Gravitational, Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package api
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/coreos/go-semver/semver"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// this is a static assertion that the shape of semver.Version hasn't changed
|
|
// under our nose, since we can't inspect unexported fields in our equality
|
|
// check and we'd potentially miss out on a discrepancy between
|
|
// semver.New(Version) and our manually assembled semver.Version
|
|
var _ semver.Version = struct {
|
|
Major int64
|
|
Minor int64
|
|
Patch int64
|
|
PreRelease semver.PreRelease
|
|
Metadata string
|
|
}{}
|
|
|
|
func TestSemVersion(t *testing.T) {
|
|
v, err := semver.NewVersion(Version)
|
|
require.NoError(t, err)
|
|
require.Equal(t, SemVer(), v)
|
|
}
|