<commit_before>
#include "/home/bmathur/c48/src/lexer.c"

int our_assert (char *input, char* expected){


int test_num = 0;
char* result = NULL;

int are_equal (char *program, char *expected){
  test_num ++ ;
  char *input =  print_token_list_debug(list_lexer(program),result);
  printf("%s\n",input);
  if(strcmp(input,expected) == 0){
    printf("test %d passed \n",test_num);
  }
  else{
    printf("test %d failed \n",test_num);
  
  }
}


void lexer_tests (){

 
  are_equal("(set position (* 60 (+ initial rate)))", "[left_paren,(][symbol,set][symbol,position][left_paren,(][identifier,*][num,60][left_paren,(][identifier,+][symbol,initial][symbol,rate][right_paren,)][right_paren,)][right_paren,)]");
  are_equal("(+ 137 349)", "[left_paren,(][identifier,+][num,137][num,349][right_paren,)]");
  are_equal("(- 1000 334)", "[left_paren,(][identifier,-][num,1000][num,334][right_paren,)]");
  are_equal("(* 5 99) ", "[left_paren,(][identifier,*][num,5][num,99][right_paren,)]");
  are_equal("(/ 10 5)","[left_paren,(][identifier,/][num,10][num,5][right_paren,)]");
  are_equal("(+ 2.7 10 ) ", "[left_paren,(][identifier,+][num,2.7][num,10][right_paren,)]");
  
  
}
void main() 
{
  lexer_tests();
}<commit_msg>lexer tests<commit_after>int test_num = 0;
char* result = NULL;

int are_equal (char *program, char *expected){
  test_num ++ ;
  char *input =  print_token_list_debug(list_lexer(program),result);
  printf("%s\n",input);
  if(strcmp(input,expected) == 0){
    printf("test %d passed \n",test_num);
  }
  else{
    printf("test %d failed \n",test_num);
  
  }
}


void lexer_tests (){

 
  are_equal("(set position (* 60 (+ initial rate)))", "[left_paren,(][symbol,set][symbol,position][left_paren,(][identifier,*][num,60][left_paren,(][identifier,+][symbol,initial][symbol,rate][right_paren,)][right_paren,)][right_paren,)]");
  are_equal("(+ 137 349)", "[left_paren,(][identifier,+][num,137][num,349][right_paren,)]");
  are_equal("(- 1000 334)", "[left_paren,(][identifier,-][num,1000][num,334][right_paren,)]");
  are_equal("(* 5 99) ", "[left_paren,(][identifier,*][num,5][num,99][right_paren,)]");
  are_equal("(/ 10 5)","[left_paren,(][identifier,/][num,10][num,5][right_paren,)]");
  are_equal("(+ 2.7 10 ) ", "[left_paren,(][identifier,+][num,2.7][num,10][right_paren,)]");
  
  
}
{'fraction_non_alphanumeric': 0.24815618221258134, 'fraction_numerical': 0.04598698481561822, 'mean_word_length': 7.062937062937063, 'pattern_counts': {'":': 0, '<': 3, '<?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': '725997', 'n_tokens_mistral': 955, 'n_tokens_neox': 882, 'n_words': 123}