Bladeren bron

Added tests for gunzip.

n1073645 5 jaren geleden
bovenliggende
commit
71078d9332
3 gewijzigde bestanden met toevoegingen van 60 en 1 verwijderingen
  1. 1 0
      tests/operations/index.mjs
  2. 58 0
      tests/operations/tests/Gunzip.mjs
  3. 1 1
      tests/operations/tests/Gzip.mjs

+ 1 - 0
tests/operations/index.mjs

@@ -42,6 +42,7 @@ import "./tests/ExtractEmailAddresses.mjs";
 import "./tests/Fork.mjs";
 import "./tests/Fork.mjs";
 import "./tests/FromDecimal.mjs";
 import "./tests/FromDecimal.mjs";
 import "./tests/Gzip.mjs";
 import "./tests/Gzip.mjs";
+import "./tests/Gunzip.mjs";
 import "./tests/Hash.mjs";
 import "./tests/Hash.mjs";
 import "./tests/HaversineDistance.mjs";
 import "./tests/HaversineDistance.mjs";
 import "./tests/Hexdump.mjs";
 import "./tests/Hexdump.mjs";

+ 58 - 0
tests/operations/tests/Gunzip.mjs

@@ -0,0 +1,58 @@
+/**
+ * Gunzip Tests.
+ *
+ * @author n1073645 [n1073645@gmail.com]
+ *
+ * @copyright Crown Copyright 2019
+ * @license Apache-2.0
+ */
+
+import TestRegister from "../../lib/TestRegister.mjs";
+
+TestRegister.addTests([
+    {
+        name: "Gunzip: No comment, no checksum and no filename",
+        input: "1f8b0800f7c8f85d00ff0dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
+        expectedOutput: "The quick brown fox jumped over the slow dog",
+        recipeConfig: [
+            {
+                op: "From Hex",
+                args: ["None"]
+            },
+            {
+                op: "Gunzip",
+                args: []
+            }
+        ]
+    },
+    {
+        name: "Gunzip: No comment, no checksum and filename",
+        input: "1f8b080843c9f85d00ff66696c656e616d65000dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
+        expectedOutput: "The quick brown fox jumped over the slow dog",
+        recipeConfig: [
+            {
+                op: "From Hex",
+                args: ["None"]
+            },
+            {
+                op: "Gunzip",
+                args: []
+            }
+        ]
+    },
+    {
+        name: "Gunzip: Has a comment, no checksum and has a filename",
+        input: "1f8b08186fc9f85d00ff66696c656e616d6500636f6d6d656e74000dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
+        expectedOutput: "The quick brown fox jumped over the slow dog",
+        recipeConfig: [
+            {
+                op: "From Hex",
+                args: ["None"]
+            },
+            {
+                op: "Gunzip",
+                args: []
+            }
+        ]
+    }
+]);

+ 1 - 1
tests/operations/tests/Gzip.mjs

@@ -1,5 +1,5 @@
 /**
 /**
- * Gzip tests.
+ * Gzip Tests.
  *
  *
  * @author n1073645 [n1073645@gmail.com]
  * @author n1073645 [n1073645@gmail.com]
  *
  *