Skip to content

Commit

Permalink
refactor: refactor internationalization test functions
Browse files Browse the repository at this point in the history
- Remove unnecessary code from the `TestI18nEN` function
- Remove unnecessary code from the `TestI18nDE` function
- Remove unnecessary code from the `TestI18nFR` function

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Nov 28, 2023
1 parent 7f0bc71 commit 93d2b26
Showing 1 changed file with 2 additions and 40 deletions.
42 changes: 2 additions & 40 deletions i18n_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,7 @@ func TestI18nEN(t *testing.T) {
},
want: "I am 18 years old",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := makeRequest(tt.args.lng, tt.args.path); got != tt.want {
t.Errorf("makeRequest() = %v, want %v", got, tt.want)
}
})
}
}

func TestI18nDE(t *testing.T) {
type args struct {
lng language.Tag
path string
}
tests := []struct {
name string
args args
want string
}{
// German
{
name: "hallo",
args: args{
Expand All @@ -134,26 +115,7 @@ func TestI18nDE(t *testing.T) {
},
want: "ich bin 18 Jahre alt",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := makeRequest(tt.args.lng, tt.args.path); got != tt.want {
t.Errorf("makeRequest() = %v, want %v", got, tt.want)
}
})
}
}

func TestI18nFR(t *testing.T) {
type args struct {
lng language.Tag
path string
}
tests := []struct {
name string
args args
want string
}{
// French
{
name: "bonjour",
args: args{
Expand Down

0 comments on commit 93d2b26

Please sign in to comment.