func assertSymbolicRef(t *testing.T, symbolicRef objects.Ref, tget string) { symbolic, target := symbolicRef.Target() util.Assert(t, symbolic) if target == nil { t.Fatalf("nil target") } util.AssertEqualString(t, target.(string), tget) util.AssertPanic(t, func() { oid := target.(*objects.ObjectId) oid.String() // for compilation }) util.AssertPanic(t, func() { oid := symbolicRef.ObjectId() oid.String() // for compilation }) }
func Test_parseInvalidFileMode(t *testing.T) { // test non-file modes p := ObjectParserForString("000200\n002000\n000644\n000755\n0120200\n01600990\n") for !p.EOF() { util.AssertPanic(t, func() { m := p.ParseFileMode(token.LF) m++ // for compilation, should not get here }) } }
func assertPeeledRef(t *testing.T, peeledRef objects.Ref, oid *objects.ObjectId) { symbolic, target := peeledRef.Target() util.Assert(t, !symbolic) if target == nil { t.Fatalf("nil target") } util.AssertEqualString(t, target.(*objects.ObjectId).String(), oid.String()) util.AssertEqualString(t, peeledRef.ObjectId().String(), oid.String()) util.AssertPanic(t, func() { s := target.(string) s += "" // for compilation }) }