Index: tests/regression/Selection/Atoms/PopAtomSelection/post/empty.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/empty.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/empty.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,2 @@
+0
+	Created by molecuilder for unselect-atom-by-id test
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id01_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id01_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id01_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,8 @@
+6
+	Created by molecuilder for select-atom-by-id
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id01_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id01_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id01_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,4 @@
+2
+	Created by molecuilder for unselect-atom-by-id
+H	0	0	0
+H	0	0	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id0_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id0_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id0_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id0_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id0_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id0_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	0	0	0
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id1_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id1_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id1_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id1_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id1_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id1_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	0	0	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id2_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id2_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id2_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id2_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id2_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id2_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	0	1	0
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id3_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id3_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id3_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id3_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id3_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id3_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	0	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id4_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id4_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id4_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id4_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id4_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id4_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	1	0	0
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id5_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id5_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id5_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id5_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id5_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id5_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	1	0	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id6_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id6_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id6_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id6_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id6_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id6_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	1	1	0
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id7_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id7_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id7_missing.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/id7_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/id7_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/id7_present.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/post/test-undo.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/post/test-undo.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/post/test-undo.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,10 @@
+8
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/pre/test.xyz
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/pre/test.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/pre/test.xyz	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,10 @@
+8
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/PopAtomSelection/testsuite-selection-pop-atom-selection.at
===================================================================
--- tests/regression/Selection/Atoms/PopAtomSelection/testsuite-selection-pop-atom-selection.at	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ tests/regression/Selection/Atoms/PopAtomSelection/testsuite-selection-pop-atom-selection.at	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,65 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2014 Frederik Heber
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+### 11. pop atom selection
+
+AT_SETUP([Selection - pop atom selection])
+AT_KEYWORDS([selection atom select-all-atoms pop-atom-selection select-atom-by-id])
+# go through all possible ids (0-7) and remove
+i=0
+while test $i -lt 8; do
+  file=id${i}_missing.xyz
+  # normal
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Selection/Atoms/PopAtomSelection/pre/test.xyz $file])
+  AT_CHECK([chmod u+w $file], 0)
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-atom-by-id ${i} --push-atom-selection --select-all-atoms --pop-atom-selection -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Selection/Atoms/PopAtomSelection/post/id${i}_missing.xyz])
+  ((i+=1))
+done
+AT_CLEANUP
+
+
+AT_SETUP([Selection - pop atom selection with Undo])
+AT_KEYWORDS([selection atom select-all-atoms pop-atom-selection select-atom-by-id undo])
+# go through all possible ids (0-7) and remove
+i=0
+while test $i -lt 8; do
+  file=id${i}_missing.xyz
+  # undo
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Selection/Atoms/PopAtomSelection/pre/test.xyz $file])
+  AT_CHECK([chmod u+w $file], 0)
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-atom-by-id ${i} --push-atom-selection --select-all-atoms --pop-atom-selection --undo -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Selection/Atoms/PopAtomSelection/post/empty.xyz])
+  ((i+=1))
+done
+AT_CLEANUP
+
+
+AT_SETUP([Selection - pop atom selection with Redo])
+AT_KEYWORDS([selection atom select-all-atoms pop-atom-selection select-atom-by-id redo])
+# go through all possible ids (0-7) and remove
+i=0
+while test $i -lt 8; do
+  file=id${i}_missing.xyz
+  # redo
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Selection/Atoms/PopAtomSelection/pre/test.xyz $file])
+  AT_CHECK([chmod u+w $file], 0)
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-atom-by-id ${i} --push-atom-selection --select-all-atoms --pop-atom-selection --undo --redo -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Selection/Atoms/PopAtomSelection/post/id${i}_missing.xyz])
+  ((i+=1))
+done
+AT_CLEANUP
