<commit_before>package medtronic

import (
	"fmt"
	"testing"
	"time"
)

func TestTimeOfDay(t *testing.T) {
	cases := []struct {
		s   string
		t   TimeOfDay
		err error
	}{
		{"00:00", 0, nil},
		{"12:00", durationToTimeOfDay(12 * time.Hour), nil},
		{"23:59", durationToTimeOfDay(24*time.Hour - 1*time.Minute), nil},
		{"01:02:03", 0, fmt.Errorf("")},
		{"24:00", 0, fmt.Errorf("")},
		{"01:60", 0, fmt.Errorf("")},
	}
	for _, c := range cases {
		if c.err == nil {
			s := c.t.String()
			if s != c.s {
				t.Errorf("%v.String() == %v, want %v", c.t, s, c.s)
			}
		}
		td, err := parseTimeOfDay(c.s)
		if err == nil {
			if c.err == nil {
				if td == c.t {
					continue
				} else {<commit_msg>Make tests timezone-independent<commit_after>package medtronic

import (
	"fmt"
	"os"
	"testing"
	"time"
)

// Force timezone to match test data.
func init() {
	os.Setenv("TZ", "America/New_York")
}

func TestTimeOfDay(t *testing.T) {
	cases := []struct {
		s   string
		t   TimeOfDay
		err error
	}{
		{"00:00", 0, nil},
		{"12:00", durationToTimeOfDay(12 * time.Hour), nil},
		{"23:59", durationToTimeOfDay(24*time.Hour - 1*time.Minute), nil},
		{"01:02:03", 0, fmt.Errorf("")},
		{"24:00", 0, fmt.Errorf("")},
		{"01:60", 0, fmt.Errorf("")},
	}
	for _, c := range cases {
		if c.err == nil {
			s := c.t.String()
			if s != c.s {
				t.Errorf("%v.String() == %v, want %v", c.t, s, c.s)
			}
		}
		td, err := parseTimeOfDay(c.s)
		if err == nil {
			if c.err == nil {
				if td == c.t {
					continue
				} else {
{'fraction_non_alphanumeric': 0.21994715984147953, 'fraction_numerical': 0.046235138705416116, 'mean_word_length': 2.8257575757575757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '708170', 'n_tokens_mistral': 766, 'n_tokens_neox': 654, 'n_words': 153}