2015-10-17 18:50:51 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2015-12-02 09:27:18 -05:00
|
|
|
"github.com/v2ray/v2ray-core/testing/assert"
|
2015-10-17 18:50:51 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestParseOS(t *testing.T) {
|
2015-12-02 09:27:18 -05:00
|
|
|
v2testing.Current(t)
|
2015-10-17 18:50:51 -04:00
|
|
|
|
|
|
|
assert.Pointer(parseOS("windows")).Equals(Windows)
|
|
|
|
assert.Pointer(parseOS("macos")).Equals(MacOS)
|
|
|
|
assert.Pointer(parseOS("linux")).Equals(Linux)
|
|
|
|
assert.Pointer(parseOS("test")).Equals(UnknownOS)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestParseArch(t *testing.T) {
|
2015-12-02 09:27:18 -05:00
|
|
|
v2testing.Current(t)
|
2015-10-17 18:50:51 -04:00
|
|
|
|
|
|
|
assert.Pointer(parseArch("x86")).Equals(X86)
|
|
|
|
assert.Pointer(parseArch("x64")).Equals(Amd64)
|
|
|
|
assert.Pointer(parseArch("arm")).Equals(Arm)
|
|
|
|
assert.Pointer(parseArch("arm64")).Equals(Arm64)
|
|
|
|
assert.Pointer(parseArch("test")).Equals(UnknownArch)
|
|
|
|
}
|