* (home): added tests for no-mem-optimization flag

This commit is contained in:
Andrey Meshkov 2020-09-11 13:21:37 +03:00
parent b3a68bb806
commit 1c88667306

View File

@ -140,6 +140,15 @@ func TestParseDisableUpdate(t *testing.T) {
} }
} }
func TestParseDisableMemoryOptimization(t *testing.T) {
if testParseOk(t).disableMemoryOptimization {
t.Fatal("empty is not disable update")
}
if !testParseOk(t, "--no-mem-optimization").disableMemoryOptimization {
t.Fatal("--no-mem-optimization is disable update")
}
}
func TestParseService(t *testing.T) { func TestParseService(t *testing.T) {
if testParseOk(t).serviceControlAction != "" { if testParseOk(t).serviceControlAction != "" {
t.Fatal("empty is no service command") t.Fatal("empty is no service command")
@ -226,12 +235,17 @@ func TestSerializeGLInet(t *testing.T) {
testSerialize(t, options{glinetMode: true}, "--glinet") testSerialize(t, options{glinetMode: true}, "--glinet")
} }
func TestSerializeDisableMemoryOptimization(t *testing.T) {
testSerialize(t, options{disableMemoryOptimization: true}, "--no-mem-optimization")
}
func TestSerializeMultiple(t *testing.T) { func TestSerializeMultiple(t *testing.T) {
testSerialize(t, options{ testSerialize(t, options{
serviceControlAction: "run", serviceControlAction: "run",
configFilename: "config", configFilename: "config",
workDir: "work", workDir: "work",
pidFile: "pid", pidFile: "pid",
disableUpdate: true, disableUpdate: true,
}, "-c", "config", "-w", "work", "-s", "run", "--pidfile", "pid", "--no-check-update") disableMemoryOptimization: true,
}, "-c", "config", "-w", "work", "-s", "run", "--pidfile", "pid", "--no-check-update", "--no-mem-optimization")
} }