Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
202c1ad
feat(prompter): add accessible prompter support
BagToad Mar 31, 2025
7b0c095
feat(md prompter): md prompt respects blankAllowed
BagToad Mar 31, 2025
e973ee3
fix(md prompter): accessible prompt allows blank
BagToad Mar 31, 2025
92b1a8e
test(prompter): remove t.parallel calls
BagToad Mar 31, 2025
88a98ea
feat(prompter): include `no` as false-y value
BagToad Apr 2, 2025
f7de9e0
test(prompter): `go-expect` based prompter tests
BagToad Apr 2, 2025
94bbd26
fix(prompter): rename huhprompter
BagToad Apr 2, 2025
0d7fd36
test(prompter): replace assert with require
BagToad Apr 2, 2025
e42af35
tests(prompter): rename huhprompter
BagToad Apr 2, 2025
e299b56
test(prompter): remove needless variable declaration
BagToad Apr 2, 2025
8827803
test(prompter): skip vt10x tests on Windows
BagToad Apr 2, 2025
88e6285
test(prompter): move to external package
BagToad Apr 3, 2025
02fc12e
fix(linter): linter errors
BagToad Apr 3, 2025
49ddacf
docs(prompter): doc prompter interface
BagToad Apr 3, 2025
a30df14
refactor(prompter): rename env var for speech synthesizer friendly pr…
BagToad Apr 3, 2025
5b0d49c
test(prompter): more tests for bad input
BagToad Apr 4, 2025
4cf048a
fix(prompter): input returns default when blank
BagToad Apr 4, 2025
5c39e0b
fix(prompter): notes about Confirm default
BagToad Apr 4, 2025
2e48cad
fix(prompter): remove impossible condition
BagToad Apr 4, 2025
0b49522
refactor(prompter): less magic strings
BagToad Apr 4, 2025
f897001
doc(prompter): clarify comments
BagToad Apr 4, 2025
5996f88
doc(envs): speech synthesis prompter
BagToad Apr 7, 2025
2a851e3
test(prompter): fix race conditions
BagToad Apr 7, 2025
0543aac
test(prompter): add basic survey prompter test
BagToad Apr 7, 2025
6640740
doc: comment typos and formatting
BagToad Apr 7, 2025
c5ffb3c
test: use example.com in tests
BagToad Apr 7, 2025
fb80b5b
test(prompter): remove needless NO_COLOR set
BagToad Apr 7, 2025
d8d3874
fix(prompter): use os.lookupenv for accessible prompter
BagToad Apr 8, 2025
ef58e62
test(prompter): timeout for tests is 1s
BagToad Apr 8, 2025
c4be95a
refactor(prompter): remove unused variable
BagToad Apr 8, 2025
8821f77
doc(prompter): remove senseless comment
BagToad Apr 8, 2025
9cf3413
refactor(prompter): explicit return values
BagToad Apr 8, 2025
19387b8
fix(prompter): rename GH_ACCESSIBLE_PROMPTER
BagToad Apr 8, 2025
fa03157
doc(help): label GH_ACCESSIBLE_PROMPTER as preview
BagToad Apr 8, 2025
d230b08
test(prompter): re-add skipped test for accessible confirm default
BagToad Apr 8, 2025
8615632
Merge branch 'trunk' into kw/first-pass-accessible-prompter
BagToad Apr 9, 2025
3b2e7f7
chore: go mod tidy
BagToad Apr 9, 2025
a34c9ea
doc(prompter env): accessible prompter includes braille reader
BagToad Apr 9, 2025
8fc8486
refactor(prompter): rename speechSynthesizerFriendlyPrompter to acces…
BagToad Apr 9, 2025
2f5e896
fix(prompter): update `huh` and fix tests
BagToad Apr 9, 2025
fab0de5
fix(prompter): pass io to `huh` and refactor tests
BagToad Apr 9, 2025
4615069
chore: go mod tidy
BagToad Apr 9, 2025
47d6032
test(prompter): use *testing.T instead
BagToad Apr 10, 2025
8b70870
test(prompter): describe why echo is editorcmd
BagToad Apr 10, 2025
9eee77a
test(prompter): doc how accessible prompter tests work
BagToad Apr 10, 2025
20ff409
fix(prompter): remove needless default value assignment
BagToad Apr 10, 2025
b8cd094
Ensure markdown confirm prompt shows editor name
andyfeller Apr 10, 2025
8cd3992
test(prompter): fix race condition
BagToad Apr 10, 2025
70537de
test(prompter): fix invalid comment
BagToad Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(prompter): use *testing.T instead
  • Loading branch information
BagToad committed Apr 10, 2025
commit 47d603221d4cafebfc79619eb2296b8ea2328037
12 changes: 6 additions & 6 deletions internal/prompter/accessible_prompter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func TestSurveyPrompter(t *testing.T) {
})
}

func newTestVirtualTerminal(t testing.TB) *expect.Console {
func newTestVirtualTerminal(t *testing.T) *expect.Console {
t.Helper()

// Create a PTY and hook up a virtual terminal emulator
Expand All @@ -410,14 +410,14 @@ func newTestVirtualTerminal(t testing.TB) *expect.Console {
return console
}

func newTestAcessiblePrompter(t testing.TB, console *expect.Console) prompter.Prompter {
func newTestAcessiblePrompter(t *testing.T, console *expect.Console) prompter.Prompter {
t.Helper()

t.Setenv("GH_ACCESSIBLE_PROMPTER", "true")
return prompter.New("echo", console.Tty(), console.Tty(), console.Tty())
Comment thread
BagToad marked this conversation as resolved.
}

func newTestSurveyPrompter(t testing.TB, console *expect.Console) prompter.Prompter {
func newTestSurveyPrompter(t *testing.T, console *expect.Console) prompter.Prompter {
t.Helper()

t.Setenv("GH_ACCESSIBLE_PROMPTER", "false")
Expand All @@ -429,7 +429,7 @@ func newTestSurveyPrompter(t testing.TB, console *expect.Console) prompter.Promp
// assertion.
//
// Use WithRelaxedIO to disable this behaviour.
func failOnExpectError(t testing.TB) expect.ConsoleOpt {
func failOnExpectError(t *testing.T) expect.ConsoleOpt {
t.Helper()
return expect.WithExpectObserver(
func(matchers []expect.Matcher, buf string, err error) {
Expand All @@ -456,7 +456,7 @@ func failOnExpectError(t testing.TB) expect.ConsoleOpt {
// if any sending of input fails, without requiring an explicit assertion.
//
// Use WithRelaxedIO to disable this behaviour.
func failOnSendError(t testing.TB) expect.ConsoleOpt {
func failOnSendError(t *testing.T) expect.ConsoleOpt {
t.Helper()
return expect.WithSendObserver(
func(msg string, n int, err error) {
Expand All @@ -473,7 +473,7 @@ func failOnSendError(t testing.TB) expect.ConsoleOpt {
}

// testCloser is a helper to fail the test if a Closer fails to close.
func testCloser(t testing.TB, closer io.Closer) {
func testCloser(t *testing.T, closer io.Closer) {
t.Helper()
if err := closer.Close(); err != nil {
t.Errorf("Close failed: %s", err)
Expand Down
Loading