""" Authors: Peter Mawhorter Consulted: Date: 2022-5-1 Purpose: Branching recursing lab practice tests. """ import branching import optimism testFM = optimism.testFunctionMaybe(branching, "findMax") testFM.case([]).checkReturnValue(None) testFM.case([18]).checkReturnValue(18) testFM.case([1, 2, 3, 4]).checkReturnValue(4) testFM.case([4, 2, 1, 3]).checkReturnValue(4) testFM.case([4, 4, 4]).checkReturnValue(4) testFM.case([4, 4, 5, 4, 4]).checkReturnValue(5) testPCP = optimism.testFunctionMaybe(branching, "printCoinPossibilities") testPCP.case('hht', 2).checkPrintedLines('hht') testPCP.case('h', 2).checkPrintedLines('hh', 'ht') testPCP.case('', 2).checkPrintedLines('hh', 'ht', 'th', 'tt') testPCP.case('', 3).checkPrintedLines( 'hhh', 'hht', 'hth', 'htt', 'thh', 'tht', 'tth', 'ttt' ) testPCP.case('ttht', 5).checkPrintedLines('tthth', 'tthtt')