<commit_before>context("munge function")

test_that("it correctly does nothing if no mungepieces are passed", {
  expect_equal(munge(iris), iris)
})

test_that("it correctly adds to the mungepieces list", {
  args <- lapply(seq_len(2),
    function(.) list(column_transformation(function(x) x), 1))
  iris2 <- munge(iris, args)
  expect_equal(length(attr(iris2, 'mungepieces')), 2)
})

test_that("it correctly munges a simple mungepiece sequence", {
  args <- lapply(seq_len(2),
    function(.) list(column_transformation(function(x) 2 * x), 1))
  iris2 <- munge(iris, args)
  expect_equal(iris2[[1]], iris[[1]] * 4)
})

test_that("it correctly predicts a simple mungepiece sequence", {
  args <- lapply(seq_len(2),<commit_msg>make test slightly more comprehensive for variable args<commit_after>context("munge function")

test_that("it correctly does nothing if no mungepieces are passed", {
  expect_equal(munge(iris), iris)
})

test_that("it correctly adds to the mungepieces list", {
  args <- lapply(seq_len(2),
    function(.) list(column_transformation(function(x) x), 1))
  iris2 <- munge(iris, args)
  expect_equal(length(attr(iris2, 'mungepieces')), 2)
})

test_that("it correctly munges a simple mungepiece sequence", {
  args <- lapply(seq_len(2),
    function(.) list(column_transformation(function(x, v) v * x), 1, 2))
  iris2 <- munge(iris, args)
  expect_equal(iris2[[1]], iris[[1]] * 4)
})

test_that("it correctly predicts a simple mungepiece sequence", {
  args <- lapply(seq_len(2),
{'fraction_non_alphanumeric': 0.14913448735019974, 'fraction_numerical': 0.018641810918774968, 'mean_word_length': 5.592105263157895, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3358957', 'n_tokens_mistral': 556, 'n_tokens_neox': 533, 'n_words': 130}