Index: tests/regression/Bond/SetDegree/post/test.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/post/test.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,7 @@
+REMARK created by molecuilder on Thu Apr 12 18:16:56 2012, time step 0
+ATOM      1 O01 0non 01          0.000   0.000   0.000  0.00  0.00           O 0
+ATOM      2 H01 0wat 01          0.759   0.000   0.504  0.00  0.00           H 0
+ATOM      3 H02 0non 01          0.759   0.000  -0.504  0.00  0.00           H 0
+CONECT    1    2                                                                
+CONECT    2    1                                                                
+END
Index: tests/regression/Bond/SetDegree/post/test_degree1.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_degree1.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/post/test_degree1.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,18 @@
+REMARK created by molecuilder on Sat Oct  1 19:58:03 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 H01 0tes 01          5.000   6.125   4.602  0.00  0.00           H 0
+ATOM      4 H02 0tes 01          4.026   4.438   4.602  0.00  0.00           H 0
+ATOM      5 H03 0tes 01          5.974   4.438   4.602  0.00  0.00           H 0
+ATOM      6 H04 0tes 01          5.000   6.125   6.798  0.00  0.00           H 0
+ATOM      7 H05 0tes 01          5.974   4.438   6.798  0.00  0.00           H 0
+ATOM      8 H06 0tes 01          4.026   4.438   6.798  0.00  0.00           H 0
+CONECT    1    2    3    4    5                                                 
+CONECT    2    1    6    7    8                                                 
+CONECT    3    1                                                                
+CONECT    4    1                                                                
+CONECT    5    1                                                                
+CONECT    6    2                                                                
+CONECT    7    2                                                                
+CONECT    8    2                                                                
+END
Index: tests/regression/Bond/SetDegree/post/test_degree2.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_degree2.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/post/test_degree2.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,14 @@
+REMARK created by molecuilder on Sat Oct  1 19:58:03 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 H01 0tes 01          4.438   4.205   4.311  0.00  0.00           H 0
+ATOM      4 H02 0tes 01          5.562   5.795   4.311  0.00  0.00           H 0
+ATOM      5 H03 0tes 01          5.562   5.795   7.089  0.00  0.00           H 0
+ATOM      6 H04 0tes 01          4.438   4.205   7.089  0.00  0.00           H 0
+CONECT    1    2    3    4                                                      
+CONECT    2    1    5    6                                                      
+CONECT    3    1                                                                
+CONECT    4    1                                                                
+CONECT    5    2                                                                
+CONECT    6    2                                                                
+END
Index: tests/regression/Bond/SetDegree/post/test_multiple.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_multiple.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/post/test_multiple.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,8 @@
+REMARK created by molecuilder on Wed Jan 28 21:45:49 2015, time step 0
+ATOM      1 H01 0non 01          0.000   0.000   0.000  0.00  0.00           O 0
+ATOM      2 H01 0wat 01          0.759   0.000   0.504  0.00  0.00           H 0
+ATOM      3 H02 0non 01          0.759   0.000  -0.504  0.00  0.00           H 0
+CONECT    1    2    3                                                           
+CONECT    2    1    3                                                           
+CONECT    3    1    2                                                           
+END
Index: tests/regression/Bond/SetDegree/post/test_multiple_degree1.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_multiple_degree1.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/post/test_multiple_degree1.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,34 @@
+REMARK created by molecuilder on Sat Oct  1 19:58:03 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 C03 0tes 01         10.000   5.000   5.000  0.00  0.00           C 0
+ATOM      4 C04 0tes 01         10.000   5.000   6.400  0.00  0.00           C 0
+ATOM      5 H01 0tes 01          5.000   6.125   4.602  0.00  0.00           H 0
+ATOM      6 H02 0tes 01          4.026   4.438   4.602  0.00  0.00           H 0
+ATOM      7 H03 0tes 01          5.974   4.438   4.602  0.00  0.00           H 0
+ATOM      8 H04 0tes 01          5.000   6.125   6.798  0.00  0.00           H 0
+ATOM      9 H05 0tes 01          5.974   4.438   6.798  0.00  0.00           H 0
+ATOM     10 H06 0tes 01          4.026   4.438   6.798  0.00  0.00           H 0
+ATOM     11 H07 0tes 01         10.000   6.125   4.602  0.00  0.00           H 0
+ATOM     12 H08 0tes 01          9.026   4.438   4.602  0.00  0.00           H 0
+ATOM     13 H09 0tes 01         10.974   4.438   4.602  0.00  0.00           H 0
+ATOM     14 H10 0tes 01         10.000   6.125   6.798  0.00  0.00           H 0
+ATOM     15 H11 0tes 01         10.974   4.438   6.798  0.00  0.00           H 0
+ATOM     16 H12 0tes 01          9.026   4.438   6.798  0.00  0.00           H 0
+CONECT    1    2    5    6    7                                                 
+CONECT    2    1    8    9   10                                                 
+CONECT    3    4   11   12   13                                                 
+CONECT    4    3   14   15   16                                                 
+CONECT    5    1                                                                
+CONECT    6    1                                                                
+CONECT    7    1                                                                
+CONECT    8    2                                                                
+CONECT    9    2                                                                
+CONECT   10    2                                                                
+CONECT   11    3                                                                
+CONECT   12    3                                                                
+CONECT   13    3                                                                
+CONECT   14    4                                                                
+CONECT   15    4                                                                
+CONECT   16    4                                                                
+END
Index: tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb
===================================================================
--- tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,26 @@
+REMARK created by molecuilder on Sat Oct  1 19:58:03 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 C03 0tes 01         10.000   5.000   5.000  0.00  0.00           C 0
+ATOM      4 C04 0tes 01         10.000   5.000   6.400  0.00  0.00           C 0
+ATOM      5 H01 0tes 01          4.438   4.205   4.311  0.00  0.00           H 0
+ATOM      6 H02 0tes 01          5.562   5.795   4.311  0.00  0.00           H 0
+ATOM      7 H03 0tes 01          5.562   5.795   7.089  0.00  0.00           H 0
+ATOM      8 H04 0tes 01          4.438   4.205   7.089  0.00  0.00           H 0
+ATOM      9 H05 0tes 01          9.438   4.205   4.311  0.00  0.00           H 0
+ATOM     10 H06 0tes 01         10.562   5.795   4.311  0.00  0.00           H 0
+ATOM     11 H07 0tes 01         10.562   5.795   7.089  0.00  0.00           H 0
+ATOM     12 H08 0tes 01          9.438   4.205   7.089  0.00  0.00           H 0
+CONECT    1    2    5    6                                                      
+CONECT    2    1    7    8                                                      
+CONECT    3    4    9   10                                                      
+CONECT    4    3   11   12                                                      
+CONECT    5    1                                                                
+CONECT    6    1                                                                
+CONECT    7    2                                                                
+CONECT    8    2                                                                
+CONECT    9    3                                                                
+CONECT   10    3                                                                
+CONECT   11    4                                                                
+CONECT   12    4                                                                
+END
Index: tests/regression/Bond/SetDegree/pre/.pdb
===================================================================
--- tests/regression/Bond/SetDegree/pre/.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/pre/.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,4 @@
+REMARK created by molecuilder on Sat Oct  1 19:45:11 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+END
Index: tests/regression/Bond/SetDegree/pre/test.pdb
===================================================================
--- tests/regression/Bond/SetDegree/pre/test.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/pre/test.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,6 @@
+REMARK created by molecuilder on Sat Oct  1 19:45:55 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+CONECT    1    2                                                                
+CONECT    2    1                                                                
+END
Index: tests/regression/Bond/SetDegree/pre/test_multiple.pdb
===================================================================
--- tests/regression/Bond/SetDegree/pre/test_multiple.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/pre/test_multiple.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,10 @@
+REMARK created by molecuilder on Sat Oct  1 19:45:55 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 C03 0tes 01          10.00   5.000   5.000  0.00  0.00           C 0
+ATOM      4 C04 0tes 01          10.00   5.000   6.400  0.00  0.00           C 0
+CONECT    1    2                                                                
+CONECT    2    1                                                                
+CONECT    3    4                                                                
+CONECT    4    3                                                                
+END
Index: tests/regression/Bond/SetDegree/pre/test_multiple_fail.pdb
===================================================================
--- tests/regression/Bond/SetDegree/pre/test_multiple_fail.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/pre/test_multiple_fail.pdb	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,11 @@
+REMARK created by molecuilder on Sat Oct  1 19:45:55 2016, time step 0
+ATOM      1 C01 0tes 01          5.000   5.000   5.000  0.00  0.00           C 0
+ATOM      2 C02 0tes 01          5.000   5.000   6.400  0.00  0.00           C 0
+ATOM      3 C03 0tes 01          10.00   5.000   5.000  0.00  0.00           C 0
+ATOM      4 C04 0tes 01          10.00   5.000   6.400  0.00  0.00           C 0
+ATOM      5 C05 0tes 01          15.00   5.000   5.000  0.00  0.00           C 0
+CONECT    1    2                                                                
+CONECT    2    1                                                                
+CONECT    3    4                                                                
+CONECT    4    3                                                                
+END
Index: tests/regression/Bond/SetDegree/testsuite-bond-set-degree.at
===================================================================
--- tests/regression/Bond/SetDegree/testsuite-bond-set-degree.at	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/testsuite-bond-set-degree.at	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,47 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2016 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/>.
+#
+### set degree
+
+AT_SETUP([Bond - changing degree])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms])
+file=test.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-atom-by-id 0 1 --set-bond-degree 2 --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_degree2.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+
+AT_SETUP([Bond - changing degree with Undo])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms undo])
+file=test.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-atom-by-id 0 1 --set-bond-degree 2 --undo --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_degree1.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+
+AT_SETUP([Bond - changing degree with Redo])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms redo])
+file=test.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-atom-by-id 0 1 --set-bond-degree 2 --undo --redo --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_degree2.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
Index: tests/regression/Bond/SetDegree/testsuite-bond-set-degree_multiple.at
===================================================================
--- tests/regression/Bond/SetDegree/testsuite-bond-set-degree_multiple.at	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
+++ tests/regression/Bond/SetDegree/testsuite-bond-set-degree_multiple.at	(revision 2d128074608f00c82ce22e11c436a13b8c27b359)
@@ -0,0 +1,55 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2016 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/>.
+#
+### set degree
+
+AT_SETUP([Bond - changing multiple degrees])
+AT_KEYWORDS([bond set-bond-degree])
+file=test_multiple.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-all-atoms --set-bond-degree 2 --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+
+AT_SETUP([Bond - changing multiple degrees with Undo])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms undo])
+file=test_multiple.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-all-atoms --set-bond-degree 2 --undo --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_multiple_degree1.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+
+AT_SETUP([Bond - changing multiple degrees with Redo])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms redo])
+file=test_multiple.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-all-atoms --set-bond-degree 2 --undo --redo --saturate-atoms], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Bond/SetDegree/post/test_multiple_degree2.pdb], 0, [ignore], [ignore])
+AT_CLEANUP
+
+AT_SETUP([Bond - changing multiple degrees, not all have bonds])
+AT_KEYWORDS([bond set-bond-degree saturate-atoms])
+file=test_multiple_fail.pdb
+AT_CHECK([cp -f ${abs_top_srcdir}/tests/regression/Bond/SetDegree/pre/$file $file], 0, [ignore], [ignore])
+AT_CHECK([chmod +w $file], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -i $file --select-all-atoms --set-bond-degree 2], 5, [ignore], [ignore])
+AT_CLEANUP
