Skip to content

Commit

Permalink
Fix style tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Sep 21, 2017
1 parent 551f7ce commit e5e7b57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions style_test.go
Expand Up @@ -7,16 +7,18 @@ import (
)

func TestStyleInherit(t *testing.T) {
s := NewStyle("test", StyleEntries{
s, err := NewStyle("test", StyleEntries{
Name: "bold #f00",
NameVariable: "#fff",
})
require.NoError(t, err)
require.Equal(t, &StyleEntry{Colour: 0x1000000, Bold: true}, s.Get(NameVariable))
}

func TestColours(t *testing.T) {
s := NewStyle("test", StyleEntries{
s, err := NewStyle("test", StyleEntries{
Name: "#f00 bg:#001 border:#ansiblue",
})
require.NoError(t, err)
require.Equal(t, &StyleEntry{Colour: 0xff0001, Background: 0x000012, Border: 0x000100}, s.Get(Name))
}

0 comments on commit e5e7b57

Please sign in to comment.