Batch testing of core ranking routines: readRankings, validDescription, calcNewRank, and getChoice but excluding writeRankings and runMatchup Makes use of files in tests subdirectory: posted, single, pair, nodesc, norank, badrank, nothing (recommend copying originals from subdirectory orig into tests before each run) e.g. cp orig/* tests/. Note that these tests are customized specifically for the sample solution rankings functions, and would likely need customization to be suitable for the specific collection of functions in other (student) solutions ================================== BEGINING TESTING ================================== ======================== Testing validDescription ======================== Running test validDescription(Hello) Running test validDescription(x) Running test validDescription(Ya9 ?!@ #xi) Running test validDescription() Running test validDescription( ) ======================== Testing calcNewRank ======================== Running test calcNewRank(1000,1000,1) Running test calcNewRank(1000,1000,0) Running test calcNewRank(1000,1000,0.5) Running test calcNewRank(1100,900,1) Running test calcNewRank(1100,900,0) Running test calcNewRank(1100,900,0.5) Running test calcNewRank(900,1100,1) Running test calcNewRank(900,1100,0) Running test calcNewRank(900,1100,0.5) Running test calcNewRank(1000,1000,-0.5) Error: invalid score passed (not 1, 0.5, 0), -0.5, no change applied Running test calcNewRank(1000,1000,1.5) Error: invalid score passed (not 1, 0.5, 0), 1.5, no change applied Running test calcNewRank(1000,1000,0.25) Error: invalid score passed (not 1, 0.5, 0), 0.25, no change applied ======================== Testing getChoice ======================== About to run getChoice: when asked please respond with F Given the choice between the following two items: First: Goodplyr Second: Weakplyr please enter F for first, S for second, or D for draw (tied) F About to run getChoice: when asked please respond with f Given the choice between the following two items: First: Weakplyr Second: Goodplyr please enter F for first, S for second, or D for draw (tied) f About to run getChoice: when asked please respond with S Given the choice between the following two items: First: Goodplyr Second: Weakplyr please enter F for first, S for second, or D for draw (tied) S About to run getChoice: when asked please respond with D Given the choice between the following two items: First: Goodplyr Second: Weakplyr please enter F for first, S for second, or D for draw (tied) D About to run getChoice: when asked please respond with X then s Given the choice between the following two items: First: Weakplyr Second: Goodplyr please enter F for first, S for second, or D for draw (tied) X Error, X is not a valid response, please try again please enter F for first, S for second, or D for draw (tied) s About to run getChoice: when asked please respond with ? then 3 then t then d Given the choice between the following two items: First: Goodplyr Second: Weakplyr please enter F for first, S for second, or D for draw (tied) ? Error, ? is not a valid response, please try again please enter F for first, S for second, or D for draw (tied) 3 Error, 3 is not a valid response, please try again please enter F for first, S for second, or D for draw (tied) t Error, T is not a valid response, please try again please enter F for first, S for second, or D for draw (tied) d ======================== Testing readRankings ======================== Running test readRankings(tests/posted, rankings, 50) Running test readRankings(tests/pair, rankings, 50) Running test readRankings(tests/single, rankings, 50) Running test readRankings(tests/badrank, rankings, 50) Error: invalid rank, discarding line yuk brussel sprouts Running test readRankings(tests/norank, rankings, 50) Error: invalid rank, discarding line sprouts Running test readRankings(tests/nodesc, rankings, 50) Error: invalid description, discarding line 1750 Running test readRankings(tests/nothing, rankings, 50) Running test readRankings(tests/nosuchfile, rankings, 50) Error: unable to open file tests/nosuchfile for reading ================================== FINAL TEST RESULTS passed: 31 failed: 0 ==================================