<s> import fnmatch <EOL> import os <EOL> import subprocess <EOL> import unittest <EOL> def filter_bash8_output ( output ) : <EOL> res = '<STR_LIT:\n>' <EOL> lines = output . split ( '<STR_LIT:\n>' ) <EOL> for idx in range ( len ( lines ) // <NUM_LIT:2> ) : <EOL> desc = lines [ <NUM_LIT:2> * idx ] <EOL> file_part = lines [ <NUM_LIT:2> * idx + <NUM_LIT:1> ] [ <NUM_LIT:2> : ] . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> res = res + '<STR_LIT>' % ( file_part , desc ) <EOL> return res <EOL> def filter_bashn_output ( output ) : <EOL> res = '<STR_LIT:\n>' + output <EOL> return res <EOL> class TestBash8 ( unittest . TestCase ) : <EOL> def check_bash8 ( self , fname ) : <EOL> try : <EOL> subprocess . check_output ( ( '<STR_LIT>' , fname ) ) <EOL> self . assertTrue ( True ) <EOL> except subprocess . CalledProcessError as e : <EOL> self . assertTrue ( False , filter_bash8_output ( e . output ) ) <EOL> def check_bashn ( self , fname ) : <EOL> try : <EOL> subprocess . check_output ( ( '<STR_LIT>' , '<STR_LIT>' , fname ) , <EOL> stderr = subprocess . STDOUT ) <EOL> self . assertTrue ( True ) <EOL> except subprocess . CalledProcessError as e : <EOL> self . assertTrue ( False , filter_bashn_output ( e . output ) ) <EOL> def create_methods ( tname , fname , cname ) : <EOL> mname = "<STR_LIT>" % ( tname , fname . replace ( '<STR_LIT:.>' , '<STR_LIT:_>' ) ) <EOL> def ch ( fname , mname ) : <EOL> def test_aux ( self ) : <EOL> return getattr ( self , cname ) ( os . path . join ( dirname , fname ) ) <EOL> test_aux . __name__ = mname <EOL> return test_aux <EOL> setattr ( TestBash8 , mname , ch ( fname , mname ) ) <EOL> dirname = os . path . dirname ( __file__ ) <EOL> for fname in fnmatch . filter ( os . listdir ( dirname ) , '<STR_LIT>' ) + [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> create_methods ( '<STR_LIT>' , fname , '<STR_LIT>' ) <EOL> create_methods ( '<STR_LIT>' , fname , '<STR_LIT>' ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
