Index: tests/regression/Selection/Atoms/testsuite-selection-atoms-inside-sphere.at
===================================================================
--- tests/regression/Selection/Atoms/testsuite-selection-atoms-inside-sphere.at	(revision 512f85d322a6e9f33d30dd5c0407a7abb6513ce2)
+++ tests/regression/Selection/Atoms/testsuite-selection-atoms-inside-sphere.at	(revision 512f85d322a6e9f33d30dd5c0407a7abb6513ce2)
@@ -0,0 +1,46 @@
+### 3. (un)select all atoms inside sphere
+
+AT_SETUP([Selection - All atoms inside sphere])
+AT_KEYWORDS([selection,sphere])
+file=allatomsoutsidesphere.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/pre/box.xyz $file], 0)
+AT_CHECK([../../molecuilder -i $file -v 5 --select-atoms-inside-sphere 10 --position "10,10,10" -r], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/post/$file], 0, [ignore], [ignore])
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/pre/box.xyz $file], 0)
+AT_CHECK([../../molecuilder -i $file -v 5 --select-atoms-inside-sphere 10 --position "10,10,10" --undo -r], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/pre/box.xyz], 0, [ignore], [ignore])
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/pre/box.xyz $file], 0)
+AT_CHECK([../../molecuilder -i $file -v 5 --select-atoms-inside-sphere 10 --position "10,10,10" --undo --redo -r], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/post/$file], 0, [ignore], [ignore])
+# check size of sphere
+AT_SKIP_IF([! awk '' < /dev/null])  # check whether awk is there
+AT_SKIP_IF([! cat >/dev/null < /dev/null])  # check whether cat is there
+AT_SKIP_IF([! wc -l /dev/null])  # check whether wc is there
+AT_CHECK([cat < $file | awk -F" " '{ if (($2-10)*($2-10)+($3-10)*($3-10)+($4-10)*($4-10) > 100) print $1,$2,$3,$4;}' | wc -l], 0, [stdout], [ignore])
+AT_CHECK([fgrep "507" stdout], 0, [ignore], [ignore])
+AT_CHECK([cat < $file | awk -F" " '{ if (($2-10)*($2-10)+($3-10)*($3-10)+($4-10)*($4-10) < 100) print $1,$2,$3,$4;}' | wc -l], 0, [stdout], [ignore])
+AT_CHECK([fgrep "0" stdout], 0, [ignore], [ignore])
+AT_CLEANUP
+
+AT_SETUP([Unselection - All atoms inside sphere])
+AT_KEYWORDS([selection,sphere])
+file=allatomsinsidesphere.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/pre/box.xyz $file], 0)
+AT_CHECK([../../molecuilder -i $file -v 5 --select-all-atoms --unselect-atoms-inside-sphere 10 --position "10,10,10" -r], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/post/$file], 0, [ignore], [ignore])
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/pre/box.xyz $file], 0)
+AT_CHECK([../../molecuilder -i $file -v 5 --select-all-atoms --unselect-atoms-inside-sphere 10 --position "10,10,10" --undo -r], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/post/empty.xyz], 0, [ignore], [ignore])
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/pre/box.xyz $file], 0)
+AT_CHECK([../../molecuilder -i $file -v 5 --select-all-atoms --unselect-atoms-inside-sphere 10 --position "10,10,10" --undo --redo -r], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/3/post/$file], 0, [ignore], [ignore])
+# check size of sphere
+AT_SKIP_IF([! awk '' < /dev/null])  # check whether cat is there
+AT_SKIP_IF([! cat >/dev/null < /dev/null])  # check whether awk is there
+AT_SKIP_IF([! wc -l /dev/null])  # check whether wc is there
+AT_CHECK([cat < $file | awk -F" " '{ if (($2-10)*($2-10)+($3-10)*($3-10)+($4-10)*($4-10) > 100) print $1,$2,$3,$4;}' | wc -l], 0, [stdout], [ignore])
+AT_CHECK([fgrep "2" stdout], 0, [ignore], [ignore])
+AT_CHECK([cat < $file | awk -F" " '{ if (($2-10)*($2-10)+($3-10)*($3-10)+($4-10)*($4-10) < 100) print $1,$2,$3,$4;}' | wc -l], 0, [stdout], [ignore])
+AT_CHECK([fgrep "524" stdout], 0, [ignore], [ignore])
+AT_CLEANUP
+
