ESM: Ported various tests for completed operations

This commit is contained in:
n1474335 2018-05-17 15:34:00 +00:00
parent 3fd1f4e6d9
commit 1dddcb4345
23 changed files with 44 additions and 111 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,82 +1,14 @@
/** /**
* Cipher tests. * Crypt tests.
* *
* @author Matt C [matt@artemisbot.uk]
* @author n1474335 [n1474335@gmail.com] * @author n1474335 [n1474335@gmail.com]
* *
* @copyright Crown Copyright 2017 * @copyright Crown Copyright 2018
* @license Apache-2.0 * @license Apache-2.0
*/ */
import TestRegister from "../../TestRegister.js"; import TestRegister from "../../TestRegister";
TestRegister.addTests([ 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 * Ciphers
* *

View File

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

View File

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

0
test/tests/operations/Hash.mjs Executable file → Normal file
View File

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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