diff options
| author | Carlos Martín Nieto <[email protected]> | 2014-04-26 20:24:11 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2014-04-26 20:24:11 +0200 |
| commit | 3cf0b6db80885c63986001f3217019bdf2295b71 (patch) | |
| tree | ab57488aea30266d689924ea23705a305a05103c /git_test.go | |
| parent | dca2192492a63df11365e3fecd03281e174cb788 (diff) | |
| parent | 8982f4b3be90a04b0fad24da1ee6d85b1caad336 (diff) | |
Merge pull request #80 from jezell/oid-parse-protection
make it possible to handle errors
Diffstat (limited to 'git_test.go')
| -rw-r--r-- | git_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/git_test.go b/git_test.go index 6542ca0..f4515a6 100644 --- a/git_test.go +++ b/git_test.go @@ -62,3 +62,10 @@ func TestOidZero(t *testing.T) { t.Error("Zero Oid is not zero") } } + +func TestEmptyOid(t *testing.T) { + _, err := NewOid("") + if err == nil || !IsErrorCode(err, ErrGeneric) { + t.Fatal("Should have returned invalid error") + } +} |
