diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..6c929d4803 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.golden -text diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cef3f37e1e..2511296056 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,10 @@ jobs: run: go build -v ./... working-directory: ./examples + - name: Test examples + run: go test -v ./... + working-directory: ./examples + - name: Build tutorials run: go build -v ./... working-directory: ./tutorials diff --git a/examples/simple/main_test.go b/examples/simple/main_test.go index e2d9f9730a..a2e747f6af 100644 --- a/examples/simple/main_test.go +++ b/examples/simple/main_test.go @@ -8,9 +8,15 @@ import ( "time" tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/x/exp/teatest" + "github.com/muesli/termenv" ) +func init() { + lipgloss.SetColorProfile(termenv.Ascii) +} + func TestApp(t *testing.T) { m := model(10) tm := teatest.NewTestModel( diff --git a/examples/simple/testdata/TestApp.golden b/examples/simple/testdata/TestApp.golden index 0a973b283e..b0b6c3dc97 100644 --- a/examples/simple/testdata/TestApp.golden +++ b/examples/simple/testdata/TestApp.golden @@ -1,3 +1,3 @@ -[?25lHi. This program will exit in 10 seconds. To quit sooner press any key -Hi. This program will exit in 9 seconds. To quit sooner press any key. +[?25lHi. This program will exit in 10 seconds. To quit sooner press any key +Hi. This program will exit in 9 seconds. To quit sooner press any key. [?25h[?1002l[?1003l \ No newline at end of file