@@ -353,6 +353,33 @@ describe('generateRandomString', () => {
353
353
} ) ;
354
354
} ) ;
355
355
356
+ describe ( 'stringToUnicodeEntities' , ( ) => {
357
+ it ( 'should convert a string to Unicode entities' , ( ) => {
358
+ const input = 'Hello, World!' ;
359
+ const expected = 'Hello, World!' ;
360
+ const result = Util . stringToUnicodeEntities ( input ) ;
361
+ expect ( result ) . toEqual ( expected ) ;
362
+ } ) ;
363
+ it ( 'should handle an empty string' , ( ) => {
364
+ const input = '' ;
365
+ const expected = '' ;
366
+ const result = Util . stringToUnicodeEntities ( input ) ;
367
+ expect ( result ) . toEqual ( expected ) ;
368
+ } ) ;
369
+ it ( 'should handle special characters' , ( ) => {
370
+ const input = '@#^&*()' ;
371
+ const expected = '@#^&*()' ;
372
+ const result = Util . stringToUnicodeEntities ( input ) ;
373
+ expect ( result ) . toEqual ( expected ) ;
374
+ } ) ;
375
+ it ( 'should handle non-English characters' , ( ) => {
376
+ const input = 'こんにちは' ;
377
+ const expected = 'こんにちは' ;
378
+ const result = Util . stringToUnicodeEntities ( input ) ;
379
+ expect ( result ) . toEqual ( expected ) ;
380
+ } ) ;
381
+ } ) ;
382
+
356
383
// See: https://github.com/actions/toolkit/blob/a1b068ec31a042ff1e10a522d8fdf0b8869d53ca/packages/core/src/core.ts#L89
357
384
function getInputName ( name : string ) : string {
358
385
return `INPUT_${ name . replace ( / / g, '_' ) . toUpperCase ( ) } ` ;
0 commit comments