2015-10-17 16:08:28 -04:00
|
|
|
package git
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2016-08-20 14:55:45 -04:00
|
|
|
"v2ray.com/core/testing/assert"
|
2015-10-17 16:08:28 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestRevParse(t *testing.T) {
|
2016-05-24 15:55:46 -04:00
|
|
|
assert := assert.On(t)
|
2015-10-17 16:08:28 -04:00
|
|
|
|
|
|
|
rev, err := RevParse("HEAD")
|
|
|
|
assert.Error(err).IsNil()
|
|
|
|
assert.Int(len(rev)).GreaterThan(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestRepoVersion(t *testing.T) {
|
2016-05-24 15:55:46 -04:00
|
|
|
assert := assert.On(t)
|
2015-10-17 16:08:28 -04:00
|
|
|
|
|
|
|
version, err := RepoVersionHead()
|
|
|
|
assert.Error(err).IsNil()
|
|
|
|
assert.Int(len(version)).GreaterThan(0)
|
|
|
|
}
|