<commit_before>// set output_file="none" to discard data. by default saved in /tmp
tests = (
  {
    name = "Simple HTTP",
    queries = (
      {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                    {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                   )
      }
    )
  }
  ,
  {
    name = "Simple HTTP with output file /tmp/simple",
    queries = (
      {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                    {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                   )
      }
    )
    ,output_file = "/tmp/simple"
  }
  ,
  {
    name = "Simple HTTP with validations",
    queries = (
      {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                    {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                   ),

         validations = ( { name = "response_code", value = 200, type = "int_equal"},
			 // reponse body size. For double_equal, put the decimal dot in the value or it is seen as an int!
			 // comparison types are not used yet
			 // int_equal = test of curl option of type int
			 // double_equal = test of curl option of type double
		         { name = "size_download", value = 70.0, type = "double_equal"}
		    )
      }
    )
  }
  ,
  {
    name= "Mixed case headers",
    queries = (
  {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
		)
     headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1")
  })},
  {
    name= "Host mismatch",
    queries = (
  {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
		)
     headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1", "Host: www.google.com")
  })},
  {
    name= "POST request",
    queries = (
  {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                {name = "CURLOPT_FOLLOWLOCATION", value = 1L},
                {name = "CURLOPT_POST", value = 1L},
		{name = "CURLOPT_POSTFIELDSIZE", value=20L},
		{name = "CURLOPT_POSTFIELDS", value="POST data to send..."}
		)
     headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1")
  })},

{ name = "Cumulus",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/files/cumulus.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1"),
       output_file = "/tmp/test.out"
     })},
{ name = "Inexisting file (404)",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/cumulus_blurps.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1"),
         validations = ( { name = "response_code", value = 404, type = "int_equal"}
			 // reponse body size. For double_equal, put the decimal dot in the value or it is seen as an int!
			 // comparison types are not used yet
			 // int_equal = test of curl option of type int
			 // double_equal = test of curl option of type double
		    )
     })},
{
  name = "Random",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/random.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1"),
       output_file = "/tmp/random.jpg"
     }) }
,{
  name = "random with headers",
  queries = (

    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/random.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1", "Connection: Keep-Alive")     })}
,
{ 
  name = "random with keep-alive",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/random.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  )
       ,validations = (  { name = "response_code", value = 200, type = "int_equal"}
			,{name = "size_download", value = 70.0, type = "double_equal"}
			,{name = "same_port"}
			)
       ,headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1", "Connection: Keep-Alive")
       ,repeat  = 2 })}
,{
  name = "random with close",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/random.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1", "Connection: Close") ,
       repeat  = 2 })}

//,{
//  name = "ftp",
//  queries = (
//    {
//      options = ({name = "CURLOPT_URL", value = "ftp://ftp.belnet.be/mirror/HEADER.html"}
//                  ),
//       output_file = "/tmp/belnet_header.html"
//     })}
,{
    name = "Fantasy http method with 200 response",
    queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
		 ,{name ="CURLOPT_CUSTOMREQUEST", value="x20bliptupbam"}
		  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1")
       ,validations = ( { name = "response_code", value = 200, type = "int_equal"})
       ,repeat=1
       ,output_file="/tmp/basic"
     }
      
    )
  }

,{
    name = "Fantasy http method with 400 response",
    queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
		 ,{name ="CURLOPT_CUSTOMREQUEST", value="GIVE"}
		  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1")
       ,validations = ( { name = "response_code", value = 400, type = "int_equal"})
       ,repeat=1
       ,output_file="/tmp/basic"
     }
      
    )
  }

     )<commit_msg>added id to all tests in suite<commit_after>// set output_file="none" to discard data. by default saved in /tmp
tests = (
  {
    name = "Simple HTTP",
    id = "simple_http",
    queries = (
      {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                    {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                   )
      }
    )
  }
  ,
  {
    name = "Simple HTTP with output file /tmp/simple",
    id = "simple_http_output",
    queries = (
      {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                    {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                   )
      }
    )
  }
  ,
  {
    name = "Simple HTTP with validations",
    id = "simple_http_validations",
    queries = (
      {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                    {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                   ),

         validations = ( { name = "response_code", value = 200, type = "int_equal"},
			 // reponse body size. For double_equal, put the decimal dot in the value or it is seen as an int!
			 // comparison types are not used yet
			 // int_equal = test of curl option of type int
			 // double_equal = test of curl option of type double
		         { name = "size_download", value = 70.0, type = "double_equal"}
		    )
      }
    )
  }
  ,
  {
    name= "Mixed case headers",
    id = "mixed_case_headers",
    queries = (
  {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
		)
     headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1")
  })},
  {
    name= "Host mismatch",
    id = "host_mismatch",
    queries = (
  {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
		)
     headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1", "Host: www.google.com")
  })},
  {
    name= "POST request",
    id = "post",
    queries = (
  {  options = ({name = "CURLOPT_URL", value = "http://localhost:8080"},
                {name = "CURLOPT_FOLLOWLOCATION", value = 1L},
                {name = "CURLOPT_POST", value = 1L},
		{name = "CURLOPT_POSTFIELDSIZE", value=20L},
		{name = "CURLOPT_POSTFIELDS", value="POST data to send..."}
		)
     headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1")
  })},

{ name = "Cumulus",
    id = "cumulus",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/files/cumulus.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1"),
     })},
{ name = "Inexisting file (404)",
    id = "inexisting_file",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/cumulus_blurps.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1"),
         validations = ( { name = "response_code", value = 404, type = "int_equal"}
			 // reponse body size. For double_equal, put the decimal dot in the value or it is seen as an int!
			 // comparison types are not used yet
			 // int_equal = test of curl option of type int
			 // double_equal = test of curl option of type double
		    )
     })},
{
  name = "Random",
    id = "random",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/random.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1"),
     }) }
,{
  name = "random with headers",
    id = "random_with_headers",
  queries = (

    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/random.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1", "Connection: Keep-Alive")     })}
,
{ 
  name = "random with keep-alive",
    id = "random_with_keep-alive",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/random.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  )
       ,validations = (  { name = "response_code", value = 200, type = "int_equal"}
			,{name = "size_download", value = 70.0, type = "double_equal"}
			,{name = "same_port"}
			)
       ,headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1", "Connection: Keep-Alive")
       ,repeat  = 2 })}
,{
  name = "random with close",
    id = "random_with_close",
  queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/random.jpg"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
                  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1", "Connection: Close") ,
       repeat  = 2 })}

//,{
//  name = "ftp",
//  id = "ftp",
//  queries = (
//    {
//      options = ({name = "CURLOPT_URL", value = "ftp://ftp.belnet.be/mirror/HEADER.html"}
//                  ),
//     })}
,{
    name = "Fantasy http method with 200 response",
    id = "fantasy_method_200",
    queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
		 ,{name ="CURLOPT_CUSTOMREQUEST", value="x20bliptupbam"}
		  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1")
       ,validations = ( { name = "response_code", value = 200, type = "int_equal"})
       ,repeat=1
     }
      
    )
  }

,{
    name = "Fantasy http method with 400 response",
    id = "fantasy_method_400",
    queries = (
    {
      options = ({name = "CURLOPT_URL", value = "http://localhost:8080/"},
                  {name = "CURLOPT_FOLLOWLOCATION", value = 1L}
		 ,{name ="CURLOPT_CUSTOMREQUEST", value="GIVE"}
		  ),
       headers = ( "AcCePt: text/xml", "X-MiXeD-CaSe: 1")
       ,validations = ( { name = "response_code", value = 400, type = "int_equal"})
       ,repeat=1
     }
      
    )
  }

     )
{'fraction_non_alphanumeric': 0.1659174159174159, 'fraction_numerical': 0.02047952047952048, 'mean_word_length': 2.0731644921974928, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6911011', 'n_tokens_mistral': 4580, 'n_tokens_neox': 4113, 'n_words': 922}