From 4986f164782f679190345c31a9cf0301f4786117 Mon Sep 17 00:00:00 2001 From: clubby789 Date: Sat, 1 Aug 2020 13:15:06 +0100 Subject: [PATCH] Add tests --- tests/operations/index.mjs | 1 + tests/operations/tests/BytesLong.mjs | 34 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 tests/operations/tests/BytesLong.mjs diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 8d3cd623..53305867 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -25,6 +25,7 @@ import "./tests/Base64.mjs"; import "./tests/Base62.mjs"; import "./tests/BitwiseOp.mjs"; import "./tests/ByteRepr.mjs"; +import "./tests/BytesLong.mjs"; import "./tests/CartesianProduct.mjs"; import "./tests/CharEnc.mjs"; import "./tests/ChangeIPFormat.mjs"; diff --git a/tests/operations/tests/BytesLong.mjs b/tests/operations/tests/BytesLong.mjs new file mode 100755 index 00000000..2d4f7c12 --- /dev/null +++ b/tests/operations/tests/BytesLong.mjs @@ -0,0 +1,34 @@ +/** + * Avro to JSON tests. + * + * @author jarrodconnolly [jarrod@nestedquotes.ca] + * @copyright Crown Copyright 2019 + * @license Apache-2.0 + */ + +import TestRegister from "../../lib/TestRegister"; + +TestRegister.addTests([ + { + name: "Bytes to Long", + input: "This is a testing string!", + expectedOutput: "529836718428447222471796396193323181240742300695594145834785", + recipeConfig: [ + { + op: "Bytes to Long", + args: [] + } + ], + }, + { + name: "Long to Bytes", + input: "529836718428447222471796396193323181240742300695594145834785", + expectedOutput: "This is a testing string!", + recipeConfig: [ + { + op: "Long to Bytes", + args: [] + } + ], + } +]);