zk/internal/core/style_test.go
Mickaël Menu 50855154e2
Architecture (#27)
* Move everything under the internal package.
* Better separation between core and adapter packages, for easier unit testing.
* Simplify data models.
* Support multiple opened notebooks during runtime (useful for the LSP server).
* Proper surface API which might be exposed later as a public Go package.
2021-04-14 20:14:01 +02:00

19 lines
432 B
Go

package core
import "fmt"
// stylerMock implements core.Styler by doing the transformation:
// "hello", "red" -> "red(hello)"
type stylerMock struct{}
func (s *stylerMock) Style(text string, rules ...Style) (string, error) {
return s.MustStyle(text, rules...), nil
}
func (s *stylerMock) MustStyle(text string, rules ...Style) string {
for _, rule := range rules {
text = fmt.Sprintf("%s(%s)", rule, text)
}
return text
}