first commit

This commit is contained in:
2020-10-25 10:00:59 +03:00
commit 0bd6f67397
80 changed files with 4741 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package formatter_test
import (
"context"
"testing"
"gitoa.ru/go-4devs/console/output/formatter"
)
func TestFormatter(t *testing.T) {
ctx := context.Background()
formatter := formatter.New()
cases := map[string]string{
"<info>info message</info>": "\x1b[32minfo message\x1b[39m",
"<info><command></info>": "\x1b[32m<command>\x1b[39m",
"<html>...</html>": "<html>...</html>",
}
for msg, ex := range cases {
got := formatter.Format(ctx, msg)
if ex != got {
t.Errorf("ivalid expected:%#v, got: %#v", ex, got)
}
}
}