Skip to content

Commit

Permalink
tweak tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Nov 16, 2023
1 parent 594b6b2 commit db05314
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/testit/test-sort.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ assert('server-side sort handler works', {

query = clientQuery(tbl)
out = dataTablesFilter(tbl, query)
(identical(out$data, unname(tbl)))
(out$data %==% unname(tbl))

query = clientQuery(tbl)
query$order[[1]] = orderQuery('0', 'asc')
tbl_sort = tbl[order(tbl$foo), ]
out = dataTablesFilter(tbl, query)
(identical(out$data, unname(tbl_sort)))
(out$data %==% unname(tbl_sort))

query = clientQuery(tbl)
query$order[[1]] = orderQuery('1', 'desc')
tbl_sort = tbl[order(tbl$bar, decreasing = TRUE), ]
out = dataTablesFilter(tbl, query)
(identical(out$data, unname(tbl_sort)))
(out$data %==% unname(tbl_sort))
})

assert('server-side sort handler works with re-ordered columns', {
Expand All @@ -74,5 +74,7 @@ assert('server-side sort handler works with re-ordered columns', {
query$order[[1]] = orderQuery('0', 'asc')
tbl_sort = tbl[order(tbl$bar), ]
out = dataTablesFilter(tbl, query)
(identical(out$data, unname(tbl_sort)))
(out$data %==% unname(tbl_sort))
})

options(op)

0 comments on commit db05314

Please sign in to comment.