1 | ### 3. (un)select molecules by formula
|
---|
2 |
|
---|
3 |
|
---|
4 | AT_SETUP([Selection - Molecules by formula])
|
---|
5 | AT_KEYWORDS([selection,molecule])
|
---|
6 | # some variables before
|
---|
7 | srcpath="Selection/Molecules/MoleculeByFormula"
|
---|
8 | srcfile=mix.xyz
|
---|
9 | m4_include(CheckCommand.sh)
|
---|
10 | # the tests
|
---|
11 | check_command_output $srcpath $srcfile "water.xyz" "-I --select-molecules-by-formula H2O -s water.xyz"
|
---|
12 | mv water.xyz water_a.xyz
|
---|
13 | check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecules-by-formula H2O --undo -s empty.xyz"
|
---|
14 | check_command_output $srcpath $srcfile "water.xyz" "-I --select-molecules-by-formula H2O --undo --redo -s water.xyz"
|
---|
15 | mv water.xyz water_b.xyz
|
---|
16 | AT_CHECK([diff -I '.*Created by molecuilder.*' water_a.xyz water_b.xyz], 0, [ignore], [ignore])
|
---|
17 |
|
---|
18 | check_command_output $srcpath $srcfile "ethanol.xyz" "-I --select-molecules-by-formula C2H5(OH) -s ethanol.xyz"
|
---|
19 | mv ethanol.xyz ethanol_a.xyz
|
---|
20 | check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecules-by-formula C2H5(OH) --undo -s empty.xyz"
|
---|
21 | check_command_output $srcpath $srcfile "ethanol.xyz" "-I --select-molecules-by-formula C2H5(OH) --undo --redo -s ethanol.xyz"
|
---|
22 | mv ethanol.xyz ethanol_b.xyz
|
---|
23 | AT_CHECK([diff -I '.*Created by molecuilder.*' ethanol_a.xyz ethanol_b.xyz], 0, [ignore], [ignore])
|
---|
24 |
|
---|
25 | check_command_output $srcpath $srcfile "benzene.xyz" "-I --select-molecules-by-formula C6H6 -s benzene.xyz"
|
---|
26 | mv benzene.xyz benzene_a.xyz
|
---|
27 | check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecules-by-formula C6H6 --undo -s empty.xyz"
|
---|
28 | check_command_output $srcpath $srcfile "benzene.xyz" "-I --select-molecules-by-formula C6H6 --undo --redo -s benzene.xyz"
|
---|
29 | mv benzene.xyz benzene_b.xyz
|
---|
30 | AT_CHECK([diff -I '.*Created by molecuilder.*' benzene_a.xyz benzene_b.xyz], 0, [ignore], [ignore])
|
---|
31 | AT_CLEANUP
|
---|
32 |
|
---|
33 | AT_SETUP([Unselection - Molecules by formula])
|
---|
34 | AT_KEYWORDS([selection,molecule])
|
---|
35 | # some variables before
|
---|
36 | srcpath="Selection/Molecules/MoleculeByFormula"
|
---|
37 | srcfile=mix.xyz
|
---|
38 | m4_include(CheckCommand.sh)
|
---|
39 | # the tests
|
---|
40 | check_command_output $srcpath $srcfile "water_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula H2O -s water_missing.xyz"
|
---|
41 | mv water_missing.xyz water_missing_a.xyz
|
---|
42 | check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecules-by-formula H2O --undo -s mix.xyz"
|
---|
43 | check_command_output $srcpath $srcfile "water_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula H2O --undo --redo -s water_missing.xyz"
|
---|
44 | mv water_missing.xyz water_missing_b.xyz
|
---|
45 | AT_CHECK([diff -I '.*Created by molecuilder.*' water_missing_a.xyz water_missing_b.xyz], 0, [ignore], [ignore])
|
---|
46 |
|
---|
47 | check_command_output $srcpath $srcfile "ethanol_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C2H5(OH) -s ethanol_missing.xyz"
|
---|
48 | mv ethanol_missing.xyz ethanol_missing_a.xyz
|
---|
49 | check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C2H5(OH) --undo -s mix.xyz"
|
---|
50 | check_command_output $srcpath $srcfile "ethanol_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C2H5(OH) --undo --redo -s ethanol_missing.xyz"
|
---|
51 | mv ethanol_missing.xyz ethanol_missing_b.xyz
|
---|
52 | AT_CHECK([diff -I '.*Created by molecuilder.*' ethanol_missing_a.xyz ethanol_missing_b.xyz], 0, [ignore], [ignore])
|
---|
53 |
|
---|
54 | check_command_output $srcpath $srcfile "benzene_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C6H6 -s benzene_missing.xyz"
|
---|
55 | mv benzene_missing.xyz benzene_missing_a.xyz
|
---|
56 | check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C6H6 --undo -s mix.xyz"
|
---|
57 | check_command_output $srcpath $srcfile "benzene_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C6H6 --undo --redo -s benzene_missing.xyz"
|
---|
58 | mv benzene_missing.xyz benzene_missing_b.xyz
|
---|
59 | AT_CHECK([diff -I '.*Created by molecuilder.*' benzene_missing_a.xyz benzene_missing_b.xyz], 0, [ignore], [ignore])
|
---|
60 | AT_CLEANUP
|
---|