### 3. (un)select molecules by formula AT_SETUP([Selection - Molecules by formula]) AT_KEYWORDS([selection,molecule]) # some variables before srcpath="Selection/Molecules/3" srcfile=mix.xyz m4_include(CheckCommand.sh) # the tests check_command_output $srcpath $srcfile "water.xyz" "-I --select-molecule-by-formula H2O -s water.xyz" mv water.xyz water_a.xyz check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecule-by-formula H2O --undo -s empty.xyz" check_command_output $srcpath $srcfile "water.xyz" "-I --select-molecule-by-formula H2O --undo --redo -s water.xyz" mv water.xyz water_b.xyz AT_CHECK([diff -I '.*Created by molecuilder.*' water_a.xyz water_b.xyz], 0, [ignore], [ignore]) check_command_output $srcpath $srcfile "ethanol.xyz" "-I --select-molecule-by-formula C2H5(OH) -s ethanol.xyz" mv ethanol.xyz ethanol_a.xyz check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecule-by-formula C2H5(OH) --undo -s empty.xyz" check_command_output $srcpath $srcfile "ethanol.xyz" "-I --select-molecule-by-formula C2H5(OH) --undo --redo -s ethanol.xyz" mv ethanol.xyz ethanol_b.xyz AT_CHECK([diff -I '.*Created by molecuilder.*' ethanol_a.xyz ethanol_b.xyz], 0, [ignore], [ignore]) check_command_output $srcpath $srcfile "benzene.xyz" "-I --select-molecule-by-formula C6H6 -s benzene.xyz" mv benzene.xyz benzene_a.xyz check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecule-by-formula C6H6 --undo -s empty.xyz" check_command_output $srcpath $srcfile "benzene.xyz" "-I --select-molecule-by-formula C6H6 --undo --redo -s benzene.xyz" mv benzene.xyz benzene_b.xyz AT_CHECK([diff -I '.*Created by molecuilder.*' benzene_a.xyz benzene_b.xyz], 0, [ignore], [ignore]) AT_CLEANUP AT_SETUP([Unselection - Molecules by formula]) AT_KEYWORDS([selection,molecule]) # some variables before srcpath="Selection/Molecules/3" srcfile=mix.xyz m4_include(CheckCommand.sh) # the tests check_command_output $srcpath $srcfile "water_missing.xyz" "-I --select-all-molecules --unselect-molecule-by-formula H2O -s water_missing.xyz" mv water_missing.xyz water_missing_a.xyz check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecule-by-formula H2O --undo -s mix.xyz" check_command_output $srcpath $srcfile "water_missing.xyz" "-I --select-all-molecules --unselect-molecule-by-formula H2O --undo --redo -s water_missing.xyz" mv water_missing.xyz water_missing_b.xyz AT_CHECK([diff -I '.*Created by molecuilder.*' water_missing_a.xyz water_missing_b.xyz], 0, [ignore], [ignore]) check_command_output $srcpath $srcfile "ethanol_missing.xyz" "-I --select-all-molecules --unselect-molecule-by-formula C2H5(OH) -s ethanol_missing.xyz" mv ethanol_missing.xyz ethanol_missing_a.xyz check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecule-by-formula C2H5(OH) --undo -s mix.xyz" check_command_output $srcpath $srcfile "ethanol_missing.xyz" "-I --select-all-molecules --unselect-molecule-by-formula C2H5(OH) --undo --redo -s ethanol_missing.xyz" mv ethanol_missing.xyz ethanol_missing_b.xyz AT_CHECK([diff -I '.*Created by molecuilder.*' ethanol_missing_a.xyz ethanol_missing_b.xyz], 0, [ignore], [ignore]) check_command_output $srcpath $srcfile "benzene_missing.xyz" "-I --select-all-molecules --unselect-molecule-by-formula C6H6 -s benzene_missing.xyz" mv benzene_missing.xyz benzene_missing_a.xyz check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecule-by-formula C6H6 --undo -s mix.xyz" check_command_output $srcpath $srcfile "benzene_missing.xyz" "-I --select-all-molecules --unselect-molecule-by-formula C6H6 --undo --redo -s benzene_missing.xyz" mv benzene_missing.xyz benzene_missing_b.xyz AT_CHECK([diff -I '.*Created by molecuilder.*' benzene_missing_a.xyz benzene_missing_b.xyz], 0, [ignore], [ignore]) AT_CLEANUP