| 1 | //go:build !windows |
| 2 | // +build !windows |
| 3 | |
| 4 | package tzlocal |
| 5 | |
| 6 | import "testing" |
| 7 | |
| 8 | func TestInferFromPathSuccess(t *testing.T) { |
| 9 | tz, err := inferFromPath("/usr/share/zoneinfo/Asia/Tokyo") |
| 10 | if err != nil { |
| 11 | t.Errorf("got err=%d; want: nil", err) |
| 12 | } |
| 13 | want := "Asia/Tokyo" |
| 14 | if tz != want { |
| 15 | t.Errorf("got tz=%s; want: %s", tz, want) |
| 16 | } |
| 17 | } |