tests/testthat/test-bubble-sort.R

test_that("Rust implementation works", {
  input <- c(9, 8, 7, 6, 5)
  expected <- c(5, 6, 7, 8, 9)
  expect_identical(bubble_sort(input), expected)
})

test_that("R implementation works", {
  input <- c(9, 8, 7, 6, 5)
  expected <- c(5, 6, 7, 8, 9)
  expect_identical(bubble_sort_r(input), expected)
})
ericwburden/rustbind documentation built on April 10, 2021, 12:31 p.m.