Remove date regexp (#447)
* Remove date regexp Hand-roll the date matching logic to avoid trying to match a regexp on every integer. ``` benchmark old ns/op new ns/op delta BenchmarkUnmarshalToml-8 293449 272134 -7.26% benchmark old allocs new allocs delta BenchmarkUnmarshalToml-8 2746 2650 -3.50% benchmark old bytes new bytes delta BenchmarkUnmarshalToml-8 133604 127548 -4.53% ``` * Remove fuzzit The company has been acquired by GitLab and shutting down.
This commit is contained in:
@@ -274,6 +274,34 @@ func TestLocalDate(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestLocalDateError(t *testing.T) {
|
||||
_, err := Load("a = 2020-09-31")
|
||||
if err == nil {
|
||||
t.Fatalf("should error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocalTimeError(t *testing.T) {
|
||||
_, err := Load("a = 07:99:00")
|
||||
if err == nil {
|
||||
t.Fatalf("should error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocalDateTimeError(t *testing.T) {
|
||||
_, err := Load("a = 2020-09-31T07:99:00")
|
||||
if err == nil {
|
||||
t.Fatalf("should error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDateTimeOffsetError(t *testing.T) {
|
||||
_, err := Load("a = 2020-09-31T07:99:00Z")
|
||||
if err == nil {
|
||||
t.Fatalf("should error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocalTime(t *testing.T) {
|
||||
tree, err := Load("a = 07:32:00")
|
||||
assertTree(t, tree, err, map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user