diff --git a/tests/check_intermediate.sh b/tests/check_intermediate.sh index 4815d4f1..788800f4 100755 --- a/tests/check_intermediate.sh +++ b/tests/check_intermediate.sh @@ -29,13 +29,13 @@ for path_to_cif in Resources/KnownCIFs/*.cif; do echo -e "${GREEN}CHECKING${NC} $cif..." output_path="Output/$cif" known_path="Resources/KnownCIFs/Outputs/$cif" - # In order, a-zA-Z# -> a-zA-Z, NODE# -> "", Lines with # -> "", # -> 1 decimal place - pattern="s/([a-zA-Z]+)[0-9]+/\1/g; s/NODE [0-9]+/NODE/g; s/^[ \t]*#.*//g; s/([0-9]+)(.[0-9])?[0-9]+/\1\2/g" + # In order, a-zA-Z# -> a-zA-Z, NODE# -> "", Lines with # -> "", # -> 1 decimal place, #_#+ -> "", condense whitespace + pattern="s/([a-zA-Z]+)[0-9]+/\1/g; s/NODE [0-9]+/NODE/g; s/^[ \t]*#.*//g; s/([0-9]+)(.[0-9])?[0-9]+/\1\2/g; s/[0-9]_[0-9]+//g; s/[ \t]+/\t/g" # Check orig_mol.cif - diff -b <(sed -E "$pattern" $known_path/orig_mol.cif | sort) <(sed -E "$pattern" $output_path/orig_mol.cif | sort) > /dev/null + diff -yw <(sed -E "$pattern" $known_path/orig_mol.cif | sort) <(sed -E "$pattern" $output_path/orig_mol.cif | sort) > /dev/null if [[ $? -ne 0 ]]; then echo -e "${RED}WARNING:${NC} orig_mol.cif is different" - diff -yb --suppress-common-lines <(sed -E "$pattern" $known_path/orig_mol.cif | sort) <(sed -E "$pattern" $output_path/orig_mol.cif | sort) | colordiff + diff -yw --suppress-common-lines <(sed -E "$pattern" $known_path/orig_mol.cif | sort) <(sed -E "$pattern" $output_path/orig_mol.cif | sort) | colordiff mkdir -p Mismatch/$cif/ cp -u Output/$cif/orig_mol.cif Mismatch/$cif/orig_mol.cif fi @@ -44,7 +44,7 @@ for path_to_cif in Resources/KnownCIFs/*.cif; do # Currently only checks CIF files for path_to_file in $path_to_dir/*.cif; do file="$(basename $path_to_file)" - diff -b <(sed -E "$pattern" $path_to_file | sort) <(sed -E "$pattern" $output_path/$dir/$file | sort) > /dev/null + diff -yw <(sed -E "$pattern" $path_to_file | sort) <(sed -E "$pattern" $output_path/$dir/$file | sort) > /dev/null exit_code="$?" if [[ $exit_code -ne 0 ]]; then echo -e "${YELLOW}INVESTIGATING:${NC} $cif/$dir/$file may be different..." @@ -52,7 +52,7 @@ for path_to_cif in Resources/KnownCIFs/*.cif; do bin/compare "$path_to_file" "$output_path/$dir/$file" if [[ $? -ne 0 ]]; then echo -e "${RED}WARNING:${NC} $cif/$dir/$file is different" - diff -yb --suppress-common-lines <(sed -E "$pattern" $path_to_file | sort) <(sed -E "$pattern" $output_path/$dir/$file | sort) | colordiff + diff -yw --suppress-common-lines <(sed -E "$pattern" $path_to_file | sort) <(sed -E "$pattern" $output_path/$dir/$file | sort) | colordiff mkdir -p Mismatch/$cif/$dir/ cp -u Output/$cif/$dir/$file Mismatch/$cif/$dir/$file else