Skip to content

Commit

Permalink
locale: Add test for parseEnvLc
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <github@xuanwo.io>
  • Loading branch information
Xuanwo committed Aug 3, 2020
1 parent fd9bfc6 commit f4eed8e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions locale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,23 @@ func TestDetectViaEnvLc(t *testing.T) {
})
})
}

func TestParseEnvLc(t *testing.T) {
Convey("parse env lc", t, func() {
Convey("When input en_US.UTF-8", func() {
x := parseEnvLc("en_US.UTF-8")

Convey("The lang should be en_US", func() {
So(x, ShouldEqual, "en_US")
})
})

Convey("When input C.UTF-8", func() {
x := parseEnvLc("C.UTF-8")

Convey("The lang should be en_US", func() {
So(x, ShouldEqual, "en_US")
})
})
})
}

0 comments on commit f4eed8e

Please sign in to comment.