| [512f85] | 1 | ### 6. (un)select atom by id
 | 
|---|
 | 2 | 
 | 
|---|
| [e69c87] | 3 | 
 | 
|---|
| [512f85] | 4 | AT_SETUP([Unselection - atom with specific id])
 | 
|---|
| [718542] | 5 | AT_KEYWORDS([unselection,id,atom,unselect-atom-by-id])
 | 
|---|
| [512f85] | 6 | # go through all possible ids (0-7) and remove others
 | 
|---|
 | 7 | i=0
 | 
|---|
 | 8 | while test $i -lt 8; do
 | 
|---|
 | 9 |   file=id${i}_present.xyz
 | 
|---|
 | 10 |   # normal
 | 
|---|
| [7db9bd] | 11 |   AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Selection/Atoms/AtomById/pre/test.xyz $file])
 | 
|---|
| [23b0c2] | 12 |   AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [512f85] | 13 |   AT_CHECK([../../molecuilder -i $file -v 3 --select-all-atoms --unselect-atom-by-id ${i} -r], [], [ignore], [ignore])
 | 
|---|
| [7db9bd] | 14 |   AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Selection/Atoms/AtomById/post/id${i}_present.xyz])
 | 
|---|
| [e69c87] | 15 |   ((i+=1))
 | 
|---|
 | 16 | done
 | 
|---|
 | 17 | AT_CLEANUP
 | 
|---|
 | 18 | 
 | 
|---|
 | 19 | 
 | 
|---|
 | 20 | AT_SETUP([Unselection - atom with specific id with Undo])
 | 
|---|
| [718542] | 21 | AT_KEYWORDS([unselection,id,atom,unselect-atom-by-id,undo])
 | 
|---|
| [e69c87] | 22 | # go through all possible ids (0-7) and remove others
 | 
|---|
 | 23 | i=0
 | 
|---|
 | 24 | while test $i -lt 8; do
 | 
|---|
 | 25 |   file=id${i}_present.xyz
 | 
|---|
 | 26 |   # undo
 | 
|---|
| [7db9bd] | 27 |   AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Selection/Atoms/AtomById/pre/test.xyz $file])
 | 
|---|
| [23b0c2] | 28 |   AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [512f85] | 29 |   AT_CHECK([../../molecuilder -i $file -v 3 --select-all-atoms --unselect-atom-by-id ${i} --undo -r], [], [ignore], [ignore])
 | 
|---|
| [7db9bd] | 30 |   AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Selection/Atoms/AtomById/post/empty.xyz])
 | 
|---|
| [e69c87] | 31 |   ((i+=1))
 | 
|---|
 | 32 | done
 | 
|---|
 | 33 | AT_CLEANUP
 | 
|---|
 | 34 | 
 | 
|---|
 | 35 | 
 | 
|---|
 | 36 | AT_SETUP([Unselection - atom with specific id with Redo])
 | 
|---|
| [718542] | 37 | AT_KEYWORDS([unselection,id,atom,unselect-atom-by-id,redo])
 | 
|---|
| [e69c87] | 38 | # go through all possible ids (0-7) and remove others
 | 
|---|
 | 39 | i=0
 | 
|---|
 | 40 | while test $i -lt 8; do
 | 
|---|
 | 41 |   file=id${i}_present.xyz
 | 
|---|
| [512f85] | 42 |   # redo
 | 
|---|
| [7db9bd] | 43 |   AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Selection/Atoms/AtomById/pre/test.xyz $file])
 | 
|---|
| [23b0c2] | 44 |   AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [512f85] | 45 |   AT_CHECK([../../molecuilder -i $file -v 3 --select-all-atoms --unselect-atom-by-id ${i} --undo --redo -r], [], [ignore], [ignore])
 | 
|---|
| [7db9bd] | 46 |   AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Selection/Atoms/AtomById/post/id${i}_present.xyz])
 | 
|---|
| [512f85] | 47 |   ((i+=1))
 | 
|---|
 | 48 | done
 | 
|---|
 | 49 | AT_CLEANUP
 | 
|---|