From f7b2cd5fd8fdd24422c7c6e15fab1f910031bb59 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sun, 9 Apr 2017 13:02:51 +0200 Subject: [PATCH] tests for float and double constants --- .../jwebassembly/math/MathOperations.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/de/inetsoftware/jwebassembly/math/MathOperations.java b/test/de/inetsoftware/jwebassembly/math/MathOperations.java index 1423d04..fb74631 100644 --- a/test/de/inetsoftware/jwebassembly/math/MathOperations.java +++ b/test/de/inetsoftware/jwebassembly/math/MathOperations.java @@ -53,6 +53,16 @@ public class MathOperations { rule.test( script, "intConst" ); } + @Test + public void floatConst() { + rule.test( script, "floatConst" ); + } + + @Test + public void doubleConst() { + rule.test( script, "doubleConst" ); + } + @Test public void plus() { rule.test( script, "plus", 1, 3 ); @@ -65,6 +75,16 @@ public class MathOperations { return 42; } + @Export + static float floatConst() { + return 42.5F; + } + + @Export + static double doubleConst() { + return 42.5; + } + @Export static int plus( int a, int b ) { return a + b;