<commit_before>require 'test_helper'

# > cd cyberdojo/test
# > ruby functional/language_fileset_tests.rb

class LanguageFileSetTests < ActionController::TestCase

  Root_test_folder = 'test_dojos'

  def root_test_folder_reset
    system("rm -rf #{Root_test_folder}")
    Dir.mkdir Root_test_folder
  end

  def make_params
    { :name => '<NAME>', 
      :dojo_root => Dir.getwd + '/' + Root_test_folder,
      :filesets_root => Dir.getwd + '/../filesets'
    }
  end
  
  def test_that_initial_fileset_for_csharp_is_green
    root_test_folder_reset
    params = make_params
    assert Dojo::create(params)
    dojo = Dojo.new(params)
    avatar = Avatar.new(dojo, nil, { 'language' => 'C#' })    
    manifest = {}
    avatar.read_most_recent(manifest)
    increments = avatar.run_tests(manifest)
    assert_equal :passed, increments.last[:outcome]     
  end
    
end<commit_msg>added all language's initial filesets are green tests<commit_after>require 'test_helper'

# > cd cyberdojo/test
# > ruby functional/language_fileset_tests.rb

class LanguageFileSetTests < ActionController::TestCase

  Root_test_folder = 'test_dojos'

  def root_test_folder_reset
    system("rm -rf #{Root_test_folder}")
    Dir.mkdir Root_test_folder
  end

  def make_params
    { :name => '<NAME>', 
      :dojo_root => Dir.getwd + '/' + Root_test_folder,
      :filesets_root => Dir.getwd + '/../filesets'
    }
  end
  
  def test_that_initial_fileset_for_all_languages_is_green
    root_test_folder_reset
    params = make_params
    assert Dojo::create(params)
    dojo = Dojo.new(params)
    FileSet.new(dojo.filesets_root, 'language').choices.each do |language|    
      avatar = Avatar.new(dojo, nil, { 'language' => language })    
      manifest = {}
      avatar.read_most_recent(manifest)
      increments = avatar.run_tests(manifest)
      info = language + ', ' + avatar.name
      assert_equal :passed, increments.last[:outcome], info
      p info      
    end

  end
    
end
{'fraction_non_alphanumeric': 0.10768452982810921, 'fraction_numerical': 0.0, 'mean_word_length': 3.368653421633554, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '5313233', 'n_tokens_mistral': 688, 'n_tokens_neox': 662, 'n_words': 123}