File: tz_unix_test.go

package info (click to toggle)
golang-github-thlib-go-timezone-local 0.0~git20210907.ef149e4-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 228 kB
  • sloc: makefile: 4
file content (17 lines) | stat: -rw-r--r-- 330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//go:build !windows
// +build !windows

package tzlocal

import "testing"

func TestInferFromPathSuccess(t *testing.T) {
	tz, err := inferFromPath("/usr/share/zoneinfo/Asia/Tokyo")
	if err != nil {
		t.Errorf("got err=%d; want: nil", err)
	}
	want := "Asia/Tokyo"
	if tz != want {
		t.Errorf("got tz=%s; want: %s", tz, want)
	}
}