<commit_before>#!/usr/bin/env ruby

require 'test/unit'
require 'test/filecreation'
require 'fileutils'

class TestFileUtils < Test::Unit::TestCase
  include FileCreation

  def test_rm_one_file
    create_file("testdata/a")
    FileUtils.rm_r "testdata/a"
    assert ! File.exist?("testdata/a")
  end

  def test_rm_two_files
    create_file("testdata/a")
    create_file("testdata/b")
    FileUtils.rm_r ["testdata/a", "testdata/b"]
    assert ! File.exist?("testdata/a")
    assert ! File.exist?("testdata/b")
  end

  def test_rm_filelist
    list = Rake::FileList.new << "testdata/a" << "testdata/b"
    list.each { |fn| create_file(fn) }
    FileUtils.rm_r list
    assert ! File.exist?("testdata/a")
    assert ! File.exist?("testdata/b")
  end

#   def test_delete
#     create_file("testdata/a")
#     Sys.delete_all("testdata/a")
#     assert ! File.exist?("testdata/a")
#   end

#   def test_copy
#     create_file("testdata/a")
#     Sys.copy("testdata/a", "testdata/b")
#     assert File.exist?("testdata/b")
#   end

#   def test_for_files
#     test_files = ["testdata/a.pl", "testdata/c.pl", "testdata/b.rb"]
#     test_files.each { |fn| create_file(fn) }
#     list = []
#     Sys.for_files("testdata/*.pl", "testdata/*.rb") { |fn|
#       list << fn
#     }
#     assert_equal test_files.sort, list.sort
#   end

#   def test_indir
#     here = Dir.pwd
#     Sys.makedirs("testdata/dir")
#     assert_equal "#{here}/testdata/dir", Sys.indir("testdata/dir") { Dir.pwd }
#     assert_equal here, Dir.pwd
#   end

  def test_nothing
  end
end<commit_msg>Removed old tests (were commented out). Added tests for verbose/nowrite.<commit_after>#!/usr/bin/env ruby

require 'test/unit'
require 'test/filecreation'
require 'fileutils'

class TestFileUtils < Test::Unit::TestCase
  include FileCreation

  def test_rm_one_file
    create_file("testdata/a")
    FileUtils.rm_r "testdata/a"
    assert ! File.exist?("testdata/a")
  end

  def test_rm_two_files
    create_file("testdata/a")
    create_file("testdata/b")
    FileUtils.rm_r ["testdata/a", "testdata/b"]
    assert ! File.exist?("testdata/a")
    assert ! File.exist?("testdata/b")
  end

  def test_rm_filelist
    list = Rake::FileList.new << "testdata/a" << "testdata/b"
    list.each { |fn| create_file(fn) }
    FileUtils.rm_r list
    assert ! File.exist?("testdata/a")
    assert ! File.exist?("testdata/b")
  end

  def test_verbose
    verbose true
    assert_equal true, verbose
    verbose false
    assert_equal false, verbose
    verbose(true){
      assert_equal true, verbose
    }
    assert_equal false, verbose
  end

  def test_nowrite
    nowrite true
    assert_equal true, nowrite
    nowrite false
    assert_equal false, nowrite
    nowrite(true){
      assert_equal true, nowrite
    }
    assert_equal false, nowrite
  end

end
{'fraction_non_alphanumeric': 0.13739376770538245, 'fraction_numerical': 0.0, 'mean_word_length': 3.2290419161676644, 'pattern_counts': {'":': 0, '<': 15, '<?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': '1045301', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1022, 'n_words': 198}