Skip to content

Commit

Permalink
Add StyleExpression test with referenced style from source
Browse files Browse the repository at this point in the history
  • Loading branch information
jdillon committed Jun 17, 2017
1 parent bf6e24c commit 4eb828f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class StyleExpressionTest
@Before
void setUp() {
super.setUp()
this.underTest = new StyleExpression()
this.underTest = new StyleExpression(new StyleResolver(source, 'test'))
}

@Test
Expand Down Expand Up @@ -117,4 +117,11 @@ class StyleExpressionTest
println result.toAnsi()
assert result == new AttributedString('${foo}', DEFAULT.bold().foreground(CYAN))
}

@Test
void 'evaluate with style reference'() {
source.set('test', 'very-red', 'bold,fg:red')
def string = underTest.evaluate('@{.very-red foo bar}')
assert string == new AttributedString('foo bar', BOLD.foreground(RED))
}
}

0 comments on commit 4eb828f

Please sign in to comment.