tests: cover invalid line width validation
Addresses review feedback on #2606.
This commit is contained in:
parent
28d5a1023d
commit
04756dcc2f
@ -40,5 +40,49 @@ TestRegister.addTests([
|
|||||||
"args": [10]
|
"args": [10]
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Wrap rejects zero line width",
|
||||||
|
input: "hello",
|
||||||
|
expectedOutput: "Line Width must be greater than or equal to 1.",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "Wrap",
|
||||||
|
"args": [0]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Wrap rejects negative line width",
|
||||||
|
input: "hello",
|
||||||
|
expectedOutput: "Line Width must be greater than or equal to 1.",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "Wrap",
|
||||||
|
"args": [-1]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Wrap rejects non-integer line width",
|
||||||
|
input: "hello",
|
||||||
|
expectedOutput: "Line Width must be an integer.",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "Wrap",
|
||||||
|
"args": [1.1]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Wrap rejects excessive line width",
|
||||||
|
input: "hello",
|
||||||
|
expectedOutput: "Line Width must be less than or equal to 65536.",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "Wrap",
|
||||||
|
"args": [65537]
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user