@@ -279,6 +279,36 @@ describe('hash', () => {
279279 } ) ;
280280} ) ;
281281
282+ // https://github.com/golang/go/blob/f6b93a4c358b28b350dd8fe1780c1f78e520c09c/src/strconv/atob_test.go#L36-L58
283+ describe ( 'parseBool' , ( ) => {
284+ [
285+ { input : '' , expected : false , throwsError : true } ,
286+ { input : 'asdf' , expected : false , throwsError : true } ,
287+ { input : '0' , expected : false , throwsError : false } ,
288+ { input : 'f' , expected : false , throwsError : false } ,
289+ { input : 'F' , expected : false , throwsError : false } ,
290+ { input : 'FALSE' , expected : false , throwsError : false } ,
291+ { input : 'false' , expected : false , throwsError : false } ,
292+ { input : 'False' , expected : false , throwsError : false } ,
293+ { input : '1' , expected : true , throwsError : false } ,
294+ { input : 't' , expected : true , throwsError : false } ,
295+ { input : 'T' , expected : true , throwsError : false } ,
296+ { input : 'TRUE' , expected : true , throwsError : false } ,
297+ { input : 'true' , expected : true , throwsError : false } ,
298+ { input : 'True' , expected : true , throwsError : false }
299+ ] . forEach ( ( { input, expected, throwsError} ) => {
300+ test ( `parseBool("${ input } ")` , ( ) => {
301+ if ( throwsError ) {
302+ // eslint-disable-next-line jest/no-conditional-expect
303+ expect ( ( ) => Util . parseBool ( input ) ) . toThrow ( ) ;
304+ } else {
305+ // eslint-disable-next-line jest/no-conditional-expect
306+ expect ( Util . parseBool ( input ) ) . toBe ( expected ) ;
307+ }
308+ } ) ;
309+ } ) ;
310+ } ) ;
311+
282312// See: https://github.com/actions/toolkit/blob/a1b068ec31a042ff1e10a522d8fdf0b8869d53ca/packages/core/src/core.ts#L89
283313function getInputName ( name : string ) : string {
284314 return `INPUT_${ name . replace ( / / g, '_' ) . toUpperCase ( ) } ` ;
0 commit comments