5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 18:31:39 +08:00
wails/cmd/linux_test.go
Lea Anthony 9d6ebf0fd4
Linux db (#182)
* feat: refactor linux distro detection

* linux db updates

* feat: add gccversioncommand + windows support

* fix: build-essential
2019-08-08 21:04:59 +10:00

27 lines
625 B
Go

package cmd
import "testing"
func TestUbuntuDetection(t *testing.T) {
osrelease := `
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
`
result := parseOsRelease(osrelease)
if result.Distribution != Ubuntu {
t.Errorf("expected 'Ubuntu' ID but got '%d'", result.Distribution)
}
}