Fix From BCD scheme validation
This commit is contained in:
parent
d735496641
commit
11cdb2c25c
@ -70,6 +70,10 @@ class FromBCD extends Operation {
|
||||
inputFormat = args[3],
|
||||
nibbles = [];
|
||||
|
||||
if (!encoding) {
|
||||
throw new OperationError("Invalid BCD encoding scheme");
|
||||
}
|
||||
|
||||
let output = "",
|
||||
byteArray;
|
||||
|
||||
|
||||
@ -85,6 +85,17 @@ TestRegister.addTests([
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From BCD: invalid encoding scheme",
|
||||
input: "1000",
|
||||
expectedOutput: "Invalid BCD encoding scheme",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From BCD",
|
||||
"args": ["", true, false, "Nibbles"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "BCD: raw 4 2 2 1, packed, signed",
|
||||
input: "1234567890",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user