We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
The last column of your test table has no values for two rows. Sorting that column fails.
To Reproduce
Put this into table_test.go:
func TestTable_MoreSort(t *testing.T) { table := Table{} table.AppendRows(testRows) table.AppendHeader(testHeader) table.SetStyle(styleTest) expectedOut := `(-----^------------^-----------^--------^-----------------------------) [<# >|<FIRST NAME>|<LAST NAME>|<SALARY>|< >] {-----+------------+-----------+--------+-----------------------------} [<20 >|<Jon >|<Snow >|< 2000>|<You know nothing, Jon Snow!>] [<300>|<Tyrion >|<Lannister>|< 5000>|< >] [<1 >|<Arya >|<Stark >|< 3000>|< >] \-----v------------v-----------v--------v-----------------------------/` table.SortBy([]SortBy{{Number: 5, Mode: Dsc}, {Name: "Last Name", Mode: Asc}}) assert.Equal(t, expectedOut, table.Render()) }
Expected behavior
Expactation is that empty cells are sorted according to their string, representation.
The expected output is given in the code.
Screenshots
Actual output:
(-----^------------^-----------^--------^-----------------------------) [< #>|<FIRST NAME>|<LAST NAME>|<SALARY>|< >] {-----+------------+-----------+--------+-----------------------------} [<300>|<Tyrion >|<Lannister>|< 5000>|< >] [< 20>|<Jon >|<Snow >|< 2000>|<You know nothing, Jon Snow!>] [< 1>|<Arya >|<Stark >|< 3000>|< >] \-----v------------v-----------v--------v-----------------------------/
As you see: Column 5 isn't properly sorted.
Software (please complete the following information):
The text was updated successfully, but these errors were encountered:
table: Sort should now work on missing/empty cells; fixes #305
8380d26
Release with fix: https://github.com/jedib0t/go-pretty/releases/tag/v6.5.5
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
The last column of your test table has no values for two rows. Sorting that column fails.
To Reproduce
Put this into table_test.go:
Expected behavior
Expactation is that empty cells are sorted according to their string, representation.
The expected output is given in the code.
Screenshots
Actual output:
As you see: Column 5 isn't properly sorted.
Software (please complete the following information):
The text was updated successfully, but these errors were encountered: