tbel: doc Io tests: doubleToString - 5

This commit is contained in:
nick 2024-10-30 16:49:51 +02:00
parent 7814db1620
commit bc9af20aae

View File

@ -857,7 +857,7 @@ class TbelInvokeDocsIoTest extends AbstractTbelInvokeTest {
} }
@Test @Test
public void dpubleToString_Test() throws ExecutionException, InterruptedException { public void doubleToString_Test() throws ExecutionException, InterruptedException {
msgStr = "{}"; msgStr = "{}";
decoderStr = """ decoderStr = """
var dd0 = 99993219.156013e-002; var dd0 = 99993219.156013e-002;
@ -869,10 +869,11 @@ class TbelInvokeDocsIoTest extends AbstractTbelInvokeTest {
} }
"""; """;
LinkedHashMap<String, Object> expected = new LinkedHashMap<>(); LinkedHashMap<String, Object> expected = new LinkedHashMap<>();
Double dd0 = 99993219.156013e-002d;
expected.put("dd16", "0x1.e83f862142b5bp19"); expected.put("dd16", "0x1.e83f862142b5bp19");
expected.put("dd10", "999932,19156013"); expected.put("dd10", String.format("%.8f", dd0));
Object actual = invokeScript(evalScript(decoderStr), msgStr); Object actual = invokeScript(evalScript(decoderStr), msgStr);
assertEquals(expected, actual); assertEquals(expected.toString(), actual.toString());
} }
// Flow Control // Flow Control