1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package main
import (
"testing"
"mm/internal/config"
)
// The banner says which way yolo is set, both ways.
func TestYoloColumn(t *testing.T) {
old := config.Cfg.Yolo
t.Cleanup(func() { config.Cfg.Yolo = old })
config.Cfg.Yolo = true
if got := yoloColumn(); got != "yolo: on" {
t.Errorf("yolo on: %q", got)
}
config.Cfg.Yolo = false
if got := yoloColumn(); got != "yolo: off (tools ask)" {
t.Errorf("yolo off: %q", got)
}
}
|