浏览代码

ESM: Ported various tests for completed operations

n1474335 7 年之前
父节点
当前提交
1dddcb4345

+ 21 - 20
test/index.mjs

@@ -24,33 +24,34 @@ global.ENVIRONMENT_IS_WEB = function() {
 };
 
 import TestRegister from "./TestRegister";
-// import "./tests/operations/Base58.js";
+import "./tests/operations/Base58";
 import "./tests/operations/Base64";
-// import "./tests/operations/BCD.js";
-// import "./tests/operations/BitwiseOp.js";
-// import "./tests/operations/BSON.js";
-// import "./tests/operations/ByteRepr.js";
+import "./tests/operations/BCD";
+// import "./tests/operations/BitwiseOp";
+// import "./tests/operations/BSON";
+import "./tests/operations/ByteRepr";
 import "./tests/operations/CartesianProduct";
-// import "./tests/operations/CharEnc.js";
+import "./tests/operations/CharEnc";
 import "./tests/operations/Ciphers";
 import "./tests/operations/Checksum";
-// import "./tests/operations/Code.js";
-// import "./tests/operations/Compress.js";
-// import "./tests/operations/DateTime.js";
-// import "./tests/operations/FlowControl.js";
+// import "./tests/operations/Code";
+// import "./tests/operations/Compress";
+// import "./tests/operations/Crypt";
+// import "./tests/operations/DateTime";
+// import "./tests/operations/FlowControl";
 import "./tests/operations/Hash";
-// import "./tests/operations/Hexdump.js";
-// import "./tests/operations/Image.js";
-// import "./tests/operations/MorseCode.js";
-// import "./tests/operations/MS.js";
-// import "./tests/operations/PHP.js";
-// import "./tests/operations/NetBIOS.js";
-// import "./tests/operations/OTP.js";
+import "./tests/operations/Hexdump";
+// import "./tests/operations/Image";
+import "./tests/operations/MorseCode";
+import "./tests/operations/MS";
+// import "./tests/operations/PHP";
+import "./tests/operations/NetBIOS";
+// import "./tests/operations/OTP";
 import "./tests/operations/PowerSet";
-// import "./tests/operations/Regex.js";
+// import "./tests/operations/Regex";
 import "./tests/operations/Rotate";
-// import "./tests/operations/StrUtils.js";
-// import "./tests/operations/SeqUtils.js";
+// import "./tests/operations/StrUtils";
+import "./tests/operations/SeqUtils";
 import "./tests/operations/SetDifference";
 import "./tests/operations/SetIntersection";
 import "./tests/operations/SetUnion";

+ 1 - 1
test/tests/operations/BCD.js → test/tests/operations/BCD.mjs

@@ -5,7 +5,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/BSON.js → test/tests/operations/BSON.mjs

@@ -6,7 +6,7 @@
  * @copyright Crown Copyright 2018
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/Base58.js → test/tests/operations/Base58.mjs

@@ -6,7 +6,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/BitwiseOp.js → test/tests/operations/BitwiseOp.mjs

@@ -5,7 +5,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/ByteRepr.js → test/tests/operations/ByteRepr.mjs

@@ -5,7 +5,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 const ALL_BYTES = [
     "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",

+ 1 - 1
test/tests/operations/CharEnc.js → test/tests/operations/CharEnc.mjs

@@ -5,7 +5,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/Code.js → test/tests/operations/Code.mjs

@@ -7,7 +7,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 const JPATH_TEST_DATA = {
     "store": {

+ 1 - 1
test/tests/operations/Compress.js → test/tests/operations/Compress.mjs

@@ -5,7 +5,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 3 - 71
test/tests/operations/Cipher.js → test/tests/operations/Crypt.mjs

@@ -1,82 +1,14 @@
 /**
- * Cipher tests.
+ * Crypt tests.
  *
- * @author Matt C [matt@artemisbot.uk]
  * @author n1474335 [n1474335@gmail.com]
  *
- * @copyright Crown Copyright 2017
+ * @copyright Crown Copyright 2018
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
-    {
-        name: "Bifid Cipher Encode: no input",
-        input: "",
-        expectedOutput: "",
-        recipeConfig: [
-            {
-                "op": "Bifid Cipher Encode",
-                "args": ["nothing"]
-            }
-        ],
-    },
-    {
-        name: "Bifid Cipher Encode: no key",
-        input: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
-        expectedOutput: "Vq daqcliho rmltofvlnc qbdhlcr nt qdq Fbm-Rdkkm vuoottnoi aitp al axf tdtmvt owppkaodtx.",
-        recipeConfig: [
-            {
-                "op": "Bifid Cipher Encode",
-                "args": [""]
-            }
-        ],
-    },
-    {
-        name: "Bifid Cipher Encode: normal",
-        input: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
-        expectedOutput: "Wc snpsigdd cpfrrcxnfi hikdnnp dm crc Fcb-Pdeug vueageacc vtyl sa zxm crebzp lyoeuaiwpv.",
-        recipeConfig: [
-            {
-                "op": "Bifid Cipher Encode",
-                "args": ["Schrodinger"]
-            }
-        ],
-    },
-    {
-        name: "Bifid Cipher Decode: no input",
-        input: "",
-        expectedOutput: "",
-        recipeConfig: [
-            {
-                "op": "Bifid Cipher Decode",
-                "args": ["nothing"]
-            }
-        ],
-    },
-    {
-        name: "Bifid Cipher Decode: no key",
-        input: "Vq daqcliho rmltofvlnc qbdhlcr nt qdq Fbm-Rdkkm vuoottnoi aitp al axf tdtmvt owppkaodtx.",
-        expectedOutput: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
-        recipeConfig: [
-            {
-                "op": "Bifid Cipher Decode",
-                "args": [""]
-            }
-        ],
-    },
-    {
-        name: "Bifid Cipher Decode: normal",
-        input: "Wc snpsigdd cpfrrcxnfi hikdnnp dm crc Fcb-Pdeug vueageacc vtyl sa zxm crebzp lyoeuaiwpv.",
-        expectedOutput: "We recreate conditions similar to the Van-Allen radiation belt in our secure facilities.",
-        recipeConfig: [
-            {
-                "op": "Bifid Cipher Decode",
-                "args": ["Schrodinger"]
-            }
-        ],
-    },
-
     /**
      * Ciphers
      *

+ 1 - 1
test/tests/operations/DateTime.js → test/tests/operations/DateTime.mjs

@@ -6,7 +6,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/FlowControl.js → test/tests/operations/FlowControl.mjs

@@ -6,7 +6,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 const ALL_BYTES = [
     "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",

+ 1 - 1
test/tests/operations/Hash.mjs → test/tests/operations/Hash.mjs

@@ -6,7 +6,7 @@
  * @copyright Crown Copyright 2018
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 const ALL_BYTES = [
     "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",

+ 1 - 1
test/tests/operations/Image.js → test/tests/operations/Image.mjs

@@ -7,7 +7,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/MS.js → test/tests/operations/MS.mjs

@@ -5,7 +5,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/MorseCode.js → test/tests/operations/MorseCode.mjs

@@ -6,7 +6,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/NetBIOS.js → test/tests/operations/NetBIOS.mjs

@@ -6,7 +6,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/OTP.js → test/tests/operations/OTP.mjs

@@ -6,7 +6,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/PHP.js → test/tests/operations/PHP.mjs

@@ -7,7 +7,7 @@
  * @license Apache-2.0
  */
 
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/Regex.js → test/tests/operations/Regex.mjs

@@ -5,7 +5,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/SeqUtils.js → test/tests/operations/SeqUtils.mjs

@@ -5,7 +5,7 @@
  * @copyright Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {

+ 1 - 1
test/tests/operations/StrUtils.js → test/tests/operations/StrUtils.mjs

@@ -5,7 +5,7 @@
  * @copyright Crown Copyright 2017
  * @license Apache-2.0
  */
-import TestRegister from "../../TestRegister.js";
+import TestRegister from "../../TestRegister";
 
 TestRegister.addTests([
     {