File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
main/java/net/sf/jsqlparser/expression
test/java/net/sf/jsqlparser/expression Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public double getValue() {
5151
5252 public void setValue (Double d ) {
5353 value = d ;
54+ stringValue = String .valueOf (value );
5455 }
5556
5657 @ Override
Original file line number Diff line number Diff line change 1111
1212import org .junit .jupiter .api .Test ;
1313
14+ import static org .junit .jupiter .api .Assertions .assertEquals ;
1415import static org .junit .jupiter .api .Assertions .assertThrows ;
1516
1617public class DoubleValueTest {
@@ -28,4 +29,14 @@ public void testEmptyValue() {
2829 new DoubleValue ("" );
2930 });
3031 }
32+
33+ @ Test
34+ public void shouldSetStringValue () {
35+ final DoubleValue doubleValue = new DoubleValue ("42" );
36+
37+ doubleValue .setValue (43D );
38+
39+ assertEquals (43D , doubleValue .getValue ());
40+ assertEquals ("43.0" , doubleValue .toString ());
41+ }
3142}
You can’t perform that action at this time.
0 commit comments