-
Notifications
You must be signed in to change notification settings - Fork 8
/
font_test.go
37 lines (30 loc) · 1.03 KB
/
font_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
// Copyright 2016 The lime Authors.
// Use of this source code is governed by a 2-clause
// BSD-style license that can be found in the LICENSE file.
package commands
import (
"testing"
"github.com/limetext/backend"
)
func TestIncreaseFontSize(t *testing.T) {
ed := backend.GetEditor()
w := ed.NewWindow()
defer w.Close()
w.Settings().Set("font_size", 12)
previousFontSize := w.Settings().Int("font_size")
ed.CommandHandler().RunWindowCommand(w, "increase_font_size", backend.Args{})
if val := w.Settings().Int("font_size"); val != previousFontSize+1 {
t.Errorf("increase_font_size should have increased the font by 1")
}
}
func TestDecrementFontSize(t *testing.T) {
ed := backend.GetEditor()
w := ed.NewWindow()
defer w.Close()
w.Settings().Set("font_size", 12)
previousFontSize := w.Settings().Int("font_size")
ed.CommandHandler().RunWindowCommand(w, "decrease_font_size", backend.Args{})
if val := w.Settings().Int("font_size"); val != previousFontSize-1 {
t.Errorf("increase_font_size should have increased the font by 1")
}
}