浏览文件
hostname_test.go
18 行 · 479 B历史下载| 1 | // SPDX-FileCopyrightText: Copyright The Lima Authors |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | package hostname_test |
| 5 | |
| 6 | import ( |
| 7 | "testing" |
| 8 | |
| 9 | "gotest.tools/v3/assert" |
| 10 | |
| 11 | "github.com/lima-vm/lima/v2/pkg/instance/hostname" |
| 12 | ) |
| 13 | |
| 14 | func TestFromInstName(t *testing.T) { |
| 15 | assert.Equal(t, hostname.FromInstName("default"), "lima-default") |
| 16 | assert.Equal(t, hostname.FromInstName("ubuntu-24.04"), "lima-ubuntu-24-04") |
| 17 | assert.Equal(t, hostname.FromInstName("foo_bar.baz"), "lima-foo-bar-baz") |
| 18 | } |

