Skip to content

Commit

Permalink
additional filter by name casesi + empty cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nolancon committed Oct 2, 2021
1 parent 84d35ab commit ec97f98
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions pkg/display/allcoin/allCoin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,63 @@ func TestFilterRows(t *testing.T) {
filter: "ABA",
filteredRows: [][]string{},
},
{
allRows: [][]string{
{"", "XRP", "", "", "", "ripple"},
{"", "ETH", "", "", "", "ethereum"},
{"", "LTC", "", "", "", "litecoin"},
{"", "BTC", "", "", "", "bitcoin"},
{"", "XRP", "", "", "", "ripple"},
},
filter: "ripple",
filteredRows: [][]string{
{"", "XRP", "", "", "", "ripple"},
{"", "XRP", "", "", "", "ripple"},
},
},
{
allRows: [][]string{
{"", "BNB", "", "", "", "binance"},
{"", "ETH", "", "", "", "ethereum"},
{"", "DOGE", "", "", "", "dogecoin"},
{"", "BTC", "", "", "", "bitcoin"},
{"", "XRP", "", "", "", "ripple"},
},
filter: "dogecoin",
filteredRows: [][]string{
{"", "DOGE", "", "", "", "dogecoin"},
},
},
{
allRows: [][]string{
{"", "BNB", "", "", "", "binance"},
{"", "ETH", "", "", "", "ethereum"},
{"", "BTC", "", "", "", "bitcoin"},
{"", "XRP", "", "", "", "ripple"},
},
filter: "dogecoin",
filteredRows: [][]string{},
},
{
allRows: [][]string{},
filter: "litecoin",
filteredRows: [][]string{},
},
{
allRows: [][]string{
{"", "BNB", "", "", "", "binance"},
{"", "ETH", "", "", "", "ethereum"},
{"", "BTC", "", "", "", "bitcoin"},
{"", "XRP", "", "", "", "ripple"},
},
filter: "",
filteredRows: [][]string{
{"", "BNB", "", "", "", "binance"},
{"", "ETH", "", "", "", "ethereum"},
{"", "BTC", "", "", "", "bitcoin"},
{"", "XRP", "", "", "", "ripple"},
},
},
}

for _, test := range tests {
Expand Down

0 comments on commit ec97f98

Please sign in to comment.