Right now, process_client_logs.bats and process_logs.bats each take the actual result, sort it, and diff it with the expected result ignoring whitespace.
# process_client_logs.bats
sort data/discovery/failed_login_data.txt > data/discovery_sorted.txt
sort tests/discovery_failed_login_data.txt > data/target_sorted.txt
run diff -wbB data/target_sorted.txt data/discovery_sorted.txt
assert_success
# process_logs.bats
sort tests/summary_plots.html > targets/target.txt
sort failed_login_summary.html > targets/sorted.txt
run diff -wbB targets/target.txt targets/sorted.txt
assert_success
There's a problem, though—if a line has extra whitespace, it might get sorted differently than the canonical, whitespace-normalized version!

So, to compare two files in a whitespace-insensitive way, we need to normalize whitespace and then sort :)
Right now,
process_client_logs.batsandprocess_logs.batseach take the actual result, sort it, and diff it with the expected result ignoring whitespace.There's a problem, though—if a line has extra whitespace, it might get sorted differently than the canonical, whitespace-normalized version!
So, to compare two files in a whitespace-insensitive way, we need to normalize whitespace and then sort :)