github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/updater/service/main_test.go (about) 1 // Copyright 2015 Keybase, Inc. All rights reserved. Use of 2 // this source code is governed by the included BSD license. 3 4 package main 5 6 import ( 7 "runtime" 8 "testing" 9 10 "github.com/stretchr/testify/assert" 11 "github.com/stretchr/testify/require" 12 ) 13 14 func TestServiceFlags(t *testing.T) { 15 f := flags{ 16 pathToKeybase: "keybase", 17 } 18 svc := serviceFromFlags(f, logger{}) 19 require.NotNil(t, svc) 20 } 21 22 func TestServiceFlagsEmpty(t *testing.T) { 23 svc := serviceFromFlags(flags{}, logger{}) 24 require.NotNil(t, svc) 25 } 26 27 func TestLoadFlags(t *testing.T) { 28 f, _ := loadFlags() 29 if runtime.GOOS == "linux" { 30 assert.Equal(t, "keybase", f.appName) 31 } else { 32 assert.Equal(t, "Keybase", f.appName) 33 } 34 }