forked from linuxdeepin/startdde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
46 lines (39 loc) · 964 Bytes
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
package main
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/linuxdeepin/go-lib/log"
)
func Test_ShouldUseDDEKWin(t *testing.T) {
t.Run("Test is should use DDE KWin", func(t *testing.T) {
should := shouldUseDDEKWin()
exist := Exist("/usr/bin/kwin_no_scale")
assert.Equal(t, exist, should)
})
}
func Test_doSetLogLevel(t *testing.T) {
doSetLogLevel(log.LevelDebug)
assert.Equal(t, log.LevelDebug, logger.GetLogLevel())
}
func Test_loginReminder(t *testing.T) {
tests := []struct {
name string
gsLoginReminder bool
}{
{
name: "loginReminder disabled",
gsLoginReminder: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_gSettingsConfig = &GSettingsConfig{
loginReminder: tt.gsLoginReminder,
}
loginReminder()
})
}
}