浏览代码

add new unit test for input/output encoding

Justin Donaldson 9 年之前
父节点
当前提交
136450d553
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      tests/unit/src/unit/issues/Issue5693.hx

+ 16 - 0
tests/unit/src/unit/issues/Issue5693.hx

@@ -0,0 +1,16 @@
+package unit.issues;
+import haxe.io.*;
+class Issue5693 extends Test{
+	function test(){
+		var original:Float = 0.012755102040816;
+		var btOutput:BytesOutput = new BytesOutput();
+		btOutput.writeDouble(original);
+
+		var byteArray:Bytes = btOutput.getBytes();
+
+		var btInput:BytesInput = new BytesInput(byteArray);
+		var copyVal:Float = btInput.readDouble();
+
+		eq(original, copyVal);
+	}
+}