Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed deprecated code #49

Merged
merged 2 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 0 additions & 18 deletions matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ type Matrix interface {
// NewRange allocates and returns the specified n umber of rows
NewRange(int) []MatrixRow

// NewLineStringWriter returns a new string writter to interact with a single matrix line
//
// Deprecated: use NewRow instead
NewLineStringWriter() io.StringWriter // FIXME refactor

// NewLineWriter returns a new writer interface to interact with a single matrix line
//
// Deprecated: use NewRow instead
NewLineWriter() io.Writer // FIXME refactor

// RefreshInterval returns the refresh interval of this matrix
RefreshInterval() time.Duration

Expand Down Expand Up @@ -172,14 +162,6 @@ func (m *matrixImpl) UpdateTerminal(resetCursorPosition bool) {
}
}

func (m *matrixImpl) NewLineStringWriter() io.StringWriter {
return m.NewRow()
}

func (m *matrixImpl) NewLineWriter() io.Writer {
return m.NewRow()
}

func (m *matrixImpl) NewRange(count int) []MatrixRow {
m.mx.Lock()
defer m.mx.Unlock()
Expand Down
23 changes: 3 additions & 20 deletions matrix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ import (
)

func TestMatrixWritesToTerminalOutput(t *testing.T) {
examples := generateMultiLineExamples(3)
example := generateRandomString()

matrix, cancel := startNewMatrix()
defer cancel()

matrix.NewRow().Update(examples[0])
matrix.NewLineWriter().Write([]byte(examples[1]))
matrix.NewLineStringWriter().WriteString(examples[2])
matrix.NewRow().Update(example)

assertEventualSequence(t, matrix, expectedRewriteSequenceFor(examples))
assertEventualSequence(t, matrix, example)
}

func TestMatrixUpdatesTerminalOutput(t *testing.T) {
Expand Down Expand Up @@ -88,21 +86,6 @@ func TestMatrixNewRangeOrder(t *testing.T) {
assert.Equal(t, examples, linesOf(matrix))
}

func TestWriterLineInterface(t *testing.T) {
example := generateRandomString()

matrix1, cancel1 := startNewMatrix()
defer cancel1()

matrix2, cancel2 := startNewMatrix()
defer cancel2()

matrix1.NewLineStringWriter().WriteString(example)
matrix2.NewLineWriter().Write([]byte(example))

assert.Equal(t, matrix1.(*matrixImpl).rows, matrix2.(*matrixImpl).rows)
}

func TestMatrixGetRowByID(t *testing.T) {
matrix, cancel := startNewMatrix()
defer cancel()
Expand Down