| 1 | # | 
|---|
| 2 | #    MoleCuilder - creates and alters molecular systems | 
|---|
| 3 | #    Copyright (C) 2021 Frederik Heber | 
|---|
| 4 | # | 
|---|
| 5 | #    This program is free software: you can redistribute it and/or modify | 
|---|
| 6 | #    it under the terms of the GNU General Public License as published by | 
|---|
| 7 | #    the Free Software Foundation, either version 3 of the License, or | 
|---|
| 8 | #    (at your option) any later version. | 
|---|
| 9 | # | 
|---|
| 10 | #    This program is distributed in the hope that it will be useful, | 
|---|
| 11 | #    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 12 | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 13 | #    GNU General Public License for more details. | 
|---|
| 14 | # | 
|---|
| 15 | #    You should have received a copy of the GNU General Public License | 
|---|
| 16 | #    along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
|---|
| 17 | # | 
|---|
| 18 | ### undo mark | 
|---|
| 19 |  | 
|---|
| 20 | AT_SETUP([Standard Options - undo mark]) | 
|---|
| 21 | AT_KEYWORDS([options undo-mark]) | 
|---|
| 22 |  | 
|---|
| 23 | # simple call | 
|---|
| 24 | AT_CHECK([../../molecuilder --set-undo-mark 1 --undo-till-mark], 0, [ignore], [ignore]) | 
|---|
| 25 |  | 
|---|
| 26 | # add an atom prior to undo-mark | 
|---|
| 27 | AT_CHECK([../../molecuilder -i test-simple-prior.conf --add-atom 1 --domain-position "5,5,5" --set-undo-mark 1 --undo-till-mark], 0, [stdout], [ignore]) | 
|---|
| 28 | AT_CHECK([grep -q "^Ion_Type" test-simple-prior.conf], 0, [ignore], [ignore]) | 
|---|
| 29 |  | 
|---|
| 30 | # add an atom after to undo-mark | 
|---|
| 31 | AT_CHECK([../../molecuilder -i test-simple-after.conf --set-undo-mark 1 --add-atom 1 --domain-position "5,5,5" --undo-till-mark], 0, [stdout], [ignore]) | 
|---|
| 32 | AT_CHECK([grep -q "^Ion_Type" test-simple-after.conf], 1, [ignore], [ignore]) | 
|---|
| 33 |  | 
|---|
| 34 | # add an atom and select after undo-mark: both undone | 
|---|
| 35 | AT_CHECK([../../molecuilder  -i test-simple-two-undo.conf --set-undo-mark 1 --add-atom 1 --domain-position "5,5,5" --select-all-atoms --undo-till-mark], 0, [stdout], [ignore]) | 
|---|
| 36 | AT_CHECK([grep -q "^Ion_Type" test-simple-two-undo.conf], 1, [ignore], [ignore]) | 
|---|
| 37 |  | 
|---|
| 38 | # input file with added atom: undo all (input has no undo) | 
|---|
| 39 | AT_CHECK([../../molecuilder --set-undo-mark 1 --input hydrogen.xyz --add-atom 1 --domain-position "5,5,5" --undo-till-mark --select-all-atoms], 0, [stdout], [ignore]) | 
|---|
| 40 | AT_CHECK([grep "0 atoms selected" stdout], 0, [ignore], [ignore]) | 
|---|
| 41 |  | 
|---|
| 42 | # input file with added atom, then undo-mark: nothing undone | 
|---|
| 43 | AT_CHECK([../../molecuilder --input hydrogen.xyz --add-atom 1 --domain-position "5,5,5" --set-undo-mark 1 --undo-till-mark], 0, [stdout], [ignore]) | 
|---|
| 44 | AT_CHECK([grep -q "H" hydrogen.xyz], 0, [ignore], [ignore]) | 
|---|
| 45 |  | 
|---|
| 46 | AT_CLEANUP | 
|---|