mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 04:30:56 +01:00
added pattern highlighting support
This commit is contained in:
@@ -19,6 +19,7 @@ package lib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gookit/color"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -64,6 +65,8 @@ asd igig cxxxncnc
|
||||
ONE="19191" TWO="EDD 1" THREE="X"`,
|
||||
}
|
||||
|
||||
NoColor = true
|
||||
|
||||
r, w, err := os.Pipe()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -71,6 +74,9 @@ ONE="19191" TWO="EDD 1" THREE="X"`,
|
||||
origStdout := os.Stdout
|
||||
os.Stdout = w
|
||||
|
||||
// we need to tell the color mode the io.Writer, even if we don't usw colorization
|
||||
color.SetOutput(w)
|
||||
|
||||
for mode, expect := range expects {
|
||||
testname := fmt.Sprintf("print-%s", mode)
|
||||
t.Run(testname, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user