Add "{To,From} EBCDIC" operations
This adds operations + "To EBCDIC" + "From EBCDIC" This makes use of the npm codepage package but it is not installed as a dependency. Instead I used the `make.sh` script to export pages 37 and 500. To my knowledge there is no way currently to only import individual code pages from the npm package (hence the included script). If we were to import the package directly it increases the build size by 2.7MB.
This commit is contained in:
1 parent
31e5d785fe
commit
3c15bd9e29
5 files changed
+662
No files matched your search
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* CharEnc tests.
|
||||
*
|
||||
* @author tlwr [toby@toby.codes]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../TestRegister.js";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "From EBCDIC: nothing",
|
||||
input: "",
|
||||
expectedOutput: "",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["Space"]
|
||||
},
|
||||
{
|
||||
"op": "From EBCDIC",
|
||||
"args": ["IBM EBCDIC International"]
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "From EBCDIC: hello",
|
||||
input: "88 85 93 93 96",
|
||||
expectedOutput: "hello",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["Space"]
|
||||
},
|
||||
{
|
||||
"op": "From EBCDIC",
|
||||
"args": ["IBM EBCDIC International"]
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "To EBCDIC: hello",
|
||||
input: "hello",
|
||||
expectedOutput: "88 85 93 93 96",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "To EBCDIC",
|
||||
"args": ["IBM EBCDIC International"]
|
||||
},
|
||||
{
|
||||
"op": "To Hex",
|
||||
"args": ["Space"]
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
Reference in new issue
Block a user