| 1 |
// Copyright 2023 Google LLC |
| 2 |
// |
| 3 |
// Use of this source code is governed by a BSD-style license that can be |
| 4 |
// found in the LICENSE file. |
| 5 |
|
| 6 |
package device_specific_configs |
| 7 |
|
| 8 |
import ( |
| 9 |
"testing" |
| 10 |
|
| 11 |
"github.com/stretchr/testify/assert" |
| 12 |
) |
| 13 |
|
| 14 |
func TestConfigs_MapKeyMatchesConfigName(t *testing.T) { |
| 15 |
for key, config := range Configs { |
| 16 |
t.Run(config.Name, func(t *testing.T) { |
| 17 |
assert.Equal(t, config.Name, key) |
| 18 |
}) |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
func TestConfigs_ConfigsHaveExpectedKeyValuePairs(t *testing.T) { |
| 23 |
for _, config := range Configs { |
| 24 |
t.Run(config.Name, func(t *testing.T) { |
| 25 |
var keys []string |
| 26 |
for key := range config.Keys { |
| 27 |
keys = append(keys, key) |
| 28 |
} |
| 29 |
assert.ElementsMatch(t, []string{"arch", "model", "os"}, keys) |
| 30 |
}) |
| 31 |
} |
| 32 |
} |