<commit_before>#include "../../include/catch/catch.hpp"

#include "libirc/periodic_table.h"

#include <iomanip>
#include <iostream>

TEST_CASE("Test periodic table","[periodic_table]"){
  using namespace std;
  
  using namespace irc;
  using namespace periodic_table;
  
  bool verbose{false};
  
  // Check periodic table size for supported elements
  SECTION("size"){
    REQUIRE( pt_size == 96 );
  }
  
  // Check valid atomic numbers
  SECTION("atomic numbers"){
    bool valid{false};
    for(size_t i{0}; i < pt_size + 1; i++){
      valid = valid_atomic_number(i);
    
      if(valid){
        if(verbose){
          cout << std::setw(3) << i;
          cout << " is a valid atomic number corresponding to element ";
          cout << pt_symbols[i] << ".\n";
        }
  
        REQUIRE( i > 0);
        REQUIRE( i < pt_size);
      }
      else{
        if(verbose){
          cout << std::setw(3) << i;
          cout << " is not a valid atomic number.\n";
        }
      
        REQUIRE( (i == 0 or i == pt_size) );
      }
    }
  }
  
  // Check conversion from symbol to atomic number
  SECTION("atomic number from symbol"){
    for(size_t i{1}; i < pt_size; i++){
      REQUIRE( atomic_number(pt_symbols[i]) == i );
    }
  }
  
}<commit_msg>Cleanup test for periodic table<commit_after>#include "../../include/catch/catch.hpp"

#include "libirc/periodic_table.h"

#include <iomanip>
#include <iostream>

TEST_CASE("Test periodic table","[periodic_table]"){
  using namespace std;
  
  using namespace irc;
  using namespace periodic_table;
  
  bool verbose{false};
  
  // Check periodic table size for supported elements
  SECTION("size"){
    REQUIRE( pt_size == 96 );
  }
  
  // Check valid atomic numbers
  SECTION("atomic numbers"){
    bool valid{false};
    for(size_t i{0}; i < pt_size + 1; i++){
      valid = valid_atomic_number(i);
    
      if(valid){
        REQUIRE( i > 0);
        REQUIRE( i < pt_size);
      }
      else{
        REQUIRE( (i == 0 or i == pt_size) );
      }
    }
  }
  
  // Check conversion from symbol to atomic number
  SECTION("atomic number from symbol"){
    for(size_t i{1}; i < pt_size; i++){
      REQUIRE( atomic_number(pt_symbols[i]) == i );
    }
  }
  
}
{'fraction_non_alphanumeric': 0.14234396048495734, 'fraction_numerical': 0.007184553210597216, 'mean_word_length': 2.39117199391172, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 9, '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': '342681', 'n_tokens_mistral': 782, 'n_tokens_neox': 746, 'n_words': 195}