mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-28 21:49:33 +00:00
31 lines
750 B
Go
31 lines
750 B
Go
// Copyright 2015 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package trace
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestCorruptedInputs(t *testing.T) {
|
|
// These inputs crashed parser previously.
|
|
tests := []string{
|
|
"gotrace\x00\x020",
|
|
"gotrace\x00Q00\x020",
|
|
"gotrace\x00T00\x020",
|
|
"gotrace\x00\xc3\x0200",
|
|
"go 1.5 trace\x00\x00\x00\x00\x020",
|
|
"go 1.5 trace\x00\x00\x00\x00Q00\x020",
|
|
"go 1.5 trace\x00\x00\x00\x00T00\x020",
|
|
"go 1.5 trace\x00\x00\x00\x00\xc3\x0200",
|
|
}
|
|
for _, data := range tests {
|
|
events, err := Parse(strings.NewReader(data))
|
|
if err == nil || events != nil {
|
|
t.Fatalf("no error on input: %q\n", data)
|
|
}
|
|
}
|
|
}
|