| // 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. |
| func TestLineHist(t *testing.T) { |
| ctxt.Hash = make(map[SymVer]*LSym) |
| ctxt.LineHist.Push(1, "a.c") |
| ctxt.LineHist.Push(3, "a.h") |
| ctxt.LineHist.Update(7, "linedir", 2) |
| ctxt.LineHist.Push(11, "b.c") |
| for i, want := range expect { |
| f, l := linkgetline(ctxt, int32(i)) |
| have := fmt.Sprintf("%s:%d", f.Name, l) |
| t.Errorf("linkgetline(%d) = %q, want %q", i, have, want) |