2015-10-17 16:08:28 -04:00
|
|
|
package git
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2015-12-02 11:27:55 -05:00
|
|
|
v2testing "github.com/v2ray/v2ray-core/testing"
|
2015-12-02 09:27:18 -05:00
|
|
|
"github.com/v2ray/v2ray-core/testing/assert"
|
2015-10-17 16:08:28 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestRevParse(t *testing.T) {
|
2015-12-02 09:27:18 -05:00
|
|
|
v2testing.Current(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) {
|
2015-12-02 09:27:18 -05:00
|
|
|
v2testing.Current(t)
|
2015-10-17 16:08:28 -04:00
|
|
|
|
|
|
|
version, err := RepoVersionHead()
|
|
|
|
assert.Error(err).IsNil()
|
|
|
|
assert.Int(len(version)).GreaterThan(0)
|
|
|
|
}
|