use machine_prime::{is_prime,is_prime_wc};
use std::io::Read;

//use machine_prime::{is_prime_128,is_prime_wc_128};

fn filter_composite_utf8(x: &str){
   let f = std::fs::File::open(x);
   let mut r = BufReader::new(f);
   
   for i in r.lines(){
     match i.parse::<u64>(){
      Ok(num) => assert!(!is_prime(num)),
      Err(mess) => println!("{}",mess),
     }
   }
}

fn filter_composite_utf8_128(x: &str){
   let f = std::fs::File::open(x);
   let mut r = BufReader::new(f);
   
   for i in r.lines(){
     match i.parse::<u128>(){
      Ok(num) => assert!(!is_prime(num)),
      Err(mess) => println!("{}",mess),
     }
   }
}

#[test]
fn runner(){
  filter_composite_utf8("/home/jasory/Projects/factor/sprp2.txt");
}
