@@ -345,6 +345,42 @@ TestRegister.addApiTests([
345345 assert . strictEqual ( result . toString ( ) , "begin_something_aaaaaaaaaaaaaa_end_something" ) ;
346346 } ) ,
347347
348+ it ( "chef.bake: should accept operation names from Chef Website which contain forward slash" , ( ) => {
349+ const result = chef . bake ( "I'll have the test salmon" , [
350+ { "op" : "Find / Replace" ,
351+ "args" : [ { "option" : "Regex" , "string" : "test" } , "good" , true , false , true , false ] }
352+ ] ) ;
353+ assert . strictEqual ( result . toString ( ) , "I'll have the good salmon" ) ;
354+ } ) ,
355+
356+ it ( "chef.bake: should accept operation names from Chef Website which contain a hyphen" , ( ) => {
357+ const result = chef . bake ( "I'll have the test salmon" , [
358+ { "op" : "Adler-32 Checksum" ,
359+ "args" : [ ] }
360+ ] ) ;
361+ assert . strictEqual ( result . toString ( ) , "6e4208f8" ) ;
362+ } ) ,
363+
364+ it ( "chef.bake: should accept operation names from Chef Website which contain a period" , ( ) => {
365+ const result = chef . bake ( "30 13 02 01 05 16 0e 41 6e 79 62 6f 64 79 20 74 68 65 72 65 3f" , [
366+ { "op" : "Parse ASN.1 hex string" ,
367+ "args" : [ 0 , 32 ] }
368+ ] ) ;
369+ assert . strictEqual ( result . toString ( ) , `SEQUENCE
370+ INTEGER 05
371+ IA5String 'Anybody there?'
372+ ` ) ;
373+ } ) ,
374+
375+ it ( "Excluded operations: throw a sensible error when you try and call one" , ( ) => {
376+ try {
377+ chef . fork ( ) ;
378+ } catch ( e ) {
379+ assert . strictEqual ( e . type , "ExcludedOperationError" ) ;
380+ assert . strictEqual ( e . message , "Sorry, the Fork operation is not available in the Node.js version of CyberChef." ) ;
381+ }
382+ } ) ,
383+
348384 it ( "chef.bake: cannot accept flowControl operations in recipe" , ( ) => {
349385 assert . throws ( ( ) => chef . bake ( "some input" , "magic" ) , {
350386 name : "TypeError" ,
0 commit comments