Skip to content

Commit

Permalink
test: add tests for USD currency symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
apricote committed Dec 10, 2024
1 parent 7ffdff5 commit f951a86
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/cmd/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"

"github.com/hetznercloud/cli/internal/cmd/util"
"github.com/hetznercloud/hcloud-go/v2/hcloud"

"github.com/hetznercloud/cli/internal/cmd/util"
)

func TestYesNo(t *testing.T) {
Expand Down Expand Up @@ -431,10 +432,15 @@ func TestPrice(t *testing.T) {
want string
}{
{
name: "known currency",
name: "known currency (EUR)",
price: hcloud.Price{Currency: "EUR", Gross: "5.00"},
want: "€\u00a05.00",
},
{
name: "known currency (USD)",
price: hcloud.Price{Currency: "USD", Gross: "5.00"},
want: "$\u00a05.00",
},
{
name: "unknown currency",
price: hcloud.Price{Currency: "HOL", Gross: "1.2"},
Expand Down

0 comments on commit f951a86

Please sign in to comment.