Skip to content

Commit

Permalink
fix: revert changes done for vt-repro
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed Jan 17, 2025
1 parent 0d8437c commit d501a10
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 150 deletions.
6 changes: 1 addition & 5 deletions internal/condition_reader/condition_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package condition_reader
import (
"bufio"
"errors"
"fmt"
"io"
"time"

Expand Down Expand Up @@ -31,10 +30,7 @@ func (t *ConditionReader) ReadUntilConditionOrTimeout(condition func() bool, tim
}

for !time.Now().After(deadline) {
bytes, err := t.asyncReader.Read()
if len(bytes) > 0 {
fmt.Printf("Read: %q\n", string(bytes))
}
_, err := t.asyncReader.Read()
if err != nil {
if errors.Is(err, async_reader.ErrNoData) {
// Since no data was available, let's avoid a busy loop
Expand Down
12 changes: 0 additions & 12 deletions internal/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"

"github.com/codecrafters-io/shell-tester/internal/logged_shell_asserter"
"github.com/codecrafters-io/shell-tester/internal/shell_executable"
virtual_terminal "github.com/codecrafters-io/shell-tester/internal/vt"
"github.com/codecrafters-io/tester-utils/random"
)

Expand Down Expand Up @@ -69,13 +67,3 @@ func logAndQuit(asserter *logged_shell_asserter.LoggedShellAsserter, err error)
asserter.LogRemainingOutput()
return err
}

func logScreenState(shell *shell_executable.ShellExecutable) {
screenState := shell.GetScreenState()
for _, row := range screenState {
cleanedRow := virtual_terminal.BuildCleanedRow(row)
if len(cleanedRow) > 0 {
fmt.Println(cleanedRow)
}
}
}
5 changes: 0 additions & 5 deletions internal/vt/virtual_terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ func (vt *VirtualTerminal) Write(p []byte) (n int, err error) {
if len(p) == 0 {
return 0, nil
}

// fmt.Printf("Writing: %q\n", string(p))
// if strings.Contains(string(p), "^[[31;9R") {
// return len(p), nil
// }
return vt.vt.Write(p)
}

Expand Down
60 changes: 0 additions & 60 deletions main.go

This file was deleted.

68 changes: 0 additions & 68 deletions mainVTExample.go

This file was deleted.

0 comments on commit d501a10

Please sign in to comment.