File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/test/java/org/scijava/convert Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,18 @@ public void testNull() {
109109 assertNull (convertService .convert (new ConversionRequest (new Object (), (Type )null )));
110110 }
111111
112+ /**
113+ * Test conversion between primitive types.
114+ */
115+ @ Test
116+ public void testPrimitives () {
117+ assertTrue (1d == convertService .convert (1 , double .class ));
118+ assertTrue (1d == convertService .convert (1l , double .class ));
119+ assertTrue (1d == convertService .convert (1.0f , double .class ));
120+ assertTrue (1d == convertService .convert ((short )1 , double .class ));
121+ assertTrue (1d == convertService .convert (1.0 , double .class ));
122+ }
123+
112124 /** Tests {@link ConvertService#supports(Class, Class)}. */
113125 @ Test
114126 public void testCanConvert () {
You can’t perform that action at this time.
0 commit comments