Fix timezone detection when time has fractional component (#544)

This commit is contained in:
Thomas Pelletier
2021-05-21 09:37:43 -04:00
committed by GitHub
parent 238a6fef7d
commit c2d1fd86e5
4 changed files with 46 additions and 3 deletions
+17
View File
@@ -145,6 +145,23 @@ func BenchmarkReferenceFile(b *testing.B) {
}
}
func BenchmarkReferenceFileMap(b *testing.B) {
bytes, err := ioutil.ReadFile("benchmark.toml")
if err != nil {
b.Fatal(err)
}
b.SetBytes(int64(len(bytes)))
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
m := map[string]interface{}{}
err := toml.Unmarshal(bytes, &m)
if err != nil {
panic(err)
}
}
}
func TestReferenceFile(t *testing.T) {
bytes, err := ioutil.ReadFile("benchmark.toml")
require.NoError(t, err)