blob: 7d066e86fe1cd2e18512fff21a56d8ad36104169 [file] [log] [blame]
Dmitry Vyukove1ee3142015-07-17 17:53:48 -07001// Copyright 2015 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package trace
6
7import (
8 "strings"
9 "testing"
10)
11
12func TestCorruptedInputs(t *testing.T) {
13 // These inputs crashed parser previously.
14 tests := []string{
15 "gotrace\x00\x020",
16 "gotrace\x00Q00\x020",
17 "gotrace\x00T00\x020",
18 "gotrace\x00\xc3\x0200",
19 }
20 for _, data := range tests {
21 events, err := Parse(strings.NewReader(data))
22 if err == nil || events != nil {
23 t.Fatalf("no error on input: %q\n", t)
24 }
25 }
26}