From: <dr...@us...> - 2003-11-23 20:52:07
|
Update of /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode.Tests/SharpCvsLib In directory sc8-pr-cvs1:/tmp/cvs-serv17347/src/ICSharpCode.Tests/SharpCvsLib Modified Files: MainTest.cs Log Message: Fixed bugs in console application parser I introduced the other day with my refactor. Fixed unit tests for parsing uncovered from CvsRoot changes. Index: MainTest.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode.Tests/SharpCvsLib/MainTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MainTest.cs 17 Nov 2003 22:40:39 -0000 1.3 --- MainTest.cs 23 Nov 2003 20:52:04 -0000 1.4 *************** *** 40,43 **** --- 40,44 ---- using ICSharpCode.SharpCvsLib.Client; using ICSharpCode.SharpCvsLib.Misc; + using ICSharpCode.SharpCvsLib.Console.Parser; using ICSharpCode.SharpCvsLib.Config.Tests; *************** *** 61,66 **** /// Constructory for test case. /// </summary> ! public MainTest () ! { buildDir = System.AppDomain.CurrentDomain.BaseDirectory; } --- 62,66 ---- /// Constructory for test case. /// </summary> ! public MainTest () { buildDir = System.AppDomain.CurrentDomain.BaseDirectory; } *************** *** 73,96 **** public void GenericHelpTest () { - // Test generic help parameter - string genericOutput = @" Usage: cvs [cvs-options] command [command-options-and-arguments] - where cvs-options are -q, -n, etc. - (specify --help-options for a list of options) - where command is add, admin, etc. - (specify --help-commands for a list of commands - or --help-synonyms for a list of command synonyms) - where command-options-and-arguments depend on the specific command - (specify -H followed by a command name for command-specific help) - Specify --help to receive this message - - The Concurrent Versions System (CVS) is a tool for version control. - For CVS updates and additional information, see - the #CvsLib home page at http://sharpcvslib.sourceforge.net/ or - the CVS home page at http://www.cvshome.org/ or - Pascal Molli's CVS site at http://www.loria.fr/~molli/cvs-index.html - the CVSNT home page at http://www.cvsnt.org/ - - Thanks for using the command line tool. - "; // Get Executable name String filename = Path.Combine (buildDir, "cvs.exe"); --- 73,76 ---- *************** *** 113,117 **** // Check the results of process output ! Assertion.AssertEquals (genericOutput, output); } /// <summary> --- 93,97 ---- // Check the results of process output ! Assertion.AssertEquals (Usage.General + "\r\n", output); } /// <summary> *************** *** 122,154 **** public void OptionHelpTest () { - // Test option help parameter - string optionOutput = @"CVS global options (specified before the command name) are: - -D prefix Adds a prefix to CVSROOT. - -H Displays usage information for command. - -Q Cause CVS to be really quiet. - -q Cause CVS to be somewhat quiet. - -r Make checked-out files read-only. - -w Make checked-out files read-write (default). - -l Turn history logging off. - -n Do not execute anything that will change the disk. - -t Show trace of program execution (repeat for more verbosity) -- try with -n. - -v CVS version and copyright. - -T tmpdir Use 'tmpdir' for temporary files. - -e editor Use 'editor' for editing log information. - -d CVS_root Overrides $CVSROOT as the root of the CVS tree. - -f Do not use the ~/.cvsrc file. - -z # Use compression level '#' for net traffic. - -x Encrypt all net traffic (fail if not encrypted). - -y Encrypt all net traffic (if supported by protocol). - -a Authenticate all net traffic. - -s VAR=VAL Set CVS user variable. - - --version CVS version and copyright. - --encrypt Encrypt all net traffic (if supported by protocol). - --authenticate Authenticate all net traffic (if supported by protocol). - (Specify the --help option for a list of other help options) - - Thanks for using the command line tool. - "; // Get Executable name String filename = Path.Combine (buildDir, "cvs.exe"); --- 102,105 ---- *************** *** 168,172 **** // Check the results of process output ! Assertion.AssertEquals (optionOutput, output); } /// <summary> --- 119,123 ---- // Check the results of process output ! Assertion.AssertEquals (Usage.Options + "\r\n", output); } /// <summary> *************** *** 177,222 **** public void CommandsHelpTest () { - string commandOutput = @"CVS commands are: - add Add a new file/directory to the repository - admin Administration front end for rcs - annotate Show last revision where each line was modified - chacl Change the Access Control List for a directory - checkout Checkout sources for editing - chown Change the owner of a directory - commit Check files into the repository - diff Show differences between revisions - edit Get ready to edit a watched file - editors See who is editing a watched file - export Export sources from CVS, similar to checkout - history Show repository access history - import Import sources into CVS, using vendor branches - init Create a CVS repository if it doesn't exist - info Display information about supported protocols - log Print out history information for files - login Prompt for password for authenticating server - logout Removes entry in .cvspass for remote repository - ls List files in the repository - lsacl List the directories Access Control List - passwd Set the user's password (Admin: Administer users) - authserver Authentication server mode - rannotate Show last revision where each line of module was modified - rdiff Create 'patch' format diffs between releases - release Indicate that a Module is no longer in use - remove Remove an entry from the repository - cvs_rename Rename a file in the repository - rlog Print out history information for a module - rtag Add a symbolic tag to a module - server Server mode - status Display status information on checked out files - tag Add a symbolic tag to checked out version of files - unedit Undo an edit command - update Bring work tree in sync with repository - version Show current CVS version(s) - watch Set watches - watchers See who is watching a file - (Specify the --help option for a list of other help options) - - Thanks for using the command line tool. - "; // Test Commands help parameter // Get Executable name --- 128,131 ---- *************** *** 237,241 **** // Check the results of process output ! Assertion.AssertEquals (commandOutput, output); } /// <summary> --- 146,150 ---- // Check the results of process output ! Assertion.AssertEquals (Usage.Commands + "\r\n", output); } /// <summary> *************** *** 246,285 **** public void SynonymsHelpTest () { - // Test Synonyms help parameter - string synonymOutput = @"CVS command synonyms are: - add ad new - admin adm rcs - annotate ann - authserver pserver - chacl setacl setperm - checkout co get - chown setowner - commit ci com - diff di dif - export exp ex - history hi his - import im imp - info inf - log lo - login logon lgn - ls dir list - lsacl lsattr listperm - passwd password setpass - rannotate rann ra - rdiff patch pa - release re rel - cvs_rename ren move - remove rm delete - rlog rl - rtag rt rfreeze - status st cvs_stat - tag ta freeze - update up upd - version ve ver - (Specify the --help option for a list of other help options) - - Thanks for using the command line tool. - "; - // Get Executable name String filename = Path.Combine (buildDir, "cvs.exe"); --- 155,158 ---- *************** *** 299,305 **** // Check the results of process output ! LOGGER.Debug ("synonym output expected=[\n" + synonymOutput + "]"); ! LOGGER.Debug ("\n\nsynonym output actual=[\n" + output + "]"); ! Assertion.AssertEquals (synonymOutput, output); } /// <summary> --- 172,176 ---- // Check the results of process output ! Assertion.AssertEquals (Usage.Synonyms + "\r\n", output); } /// <summary> *************** *** 310,332 **** public void BadHelpTest () { - // Test invalid parameters - Show usage - string badOutput = @" Usage: cvs [cvs-options] command [command-options-and-arguments] - where cvs-options are -q, -n, etc. - (specify --help-options for a list of options) - where command is add, admin, etc. - (specify --help-commands for a list of commands - or --help-synonyms for a list of command synonyms) - where command-options-and-arguments depend on the specific command - (specify -H followed by a command name for command-specific help) - Specify --help to receive this message - - The Concurrent Versions System (CVS) is a tool for version control. - For CVS updates and additional information, see - the #CvsLib home page at http://sharpcvslib.sourceforge.net/ or - the CVS home page at http://www.cvshome.org/ or - Pascal Molli's CVS site at http://www.loria.fr/~molli/cvs-index.html - the CVSNT home page at http://www.cvsnt.org/ - - "; // Get Executable name String filename = Path.Combine (buildDir, "cvs.exe"); --- 181,184 ---- *************** *** 346,350 **** // Check the results of process output ! Assertion.AssertEquals (badOutput, output); } /// <summary> --- 198,202 ---- // Check the results of process output ! Assertion.AssertEquals (Usage.General + "\r\n", output); } /// <summary> *************** *** 355,379 **** public void NoParamTest () { - // Test no parameters - string noOutput = @" Usage: cvs [cvs-options] command [command-options-and-arguments] - where cvs-options are -q, -n, etc. - (specify --help-options for a list of options) - where command is add, admin, etc. - (specify --help-commands for a list of commands - or --help-synonyms for a list of command synonyms) - where command-options-and-arguments depend on the specific command - (specify -H followed by a command name for command-specific help) - Specify --help to receive this message - - The Concurrent Versions System (CVS) is a tool for version control. - For CVS updates and additional information, see - the #CvsLib home page at http://sharpcvslib.sourceforge.net/ or - the CVS home page at http://www.cvshome.org/ or - Pascal Molli's CVS site at http://www.loria.fr/~molli/cvs-index.html - the CVSNT home page at http://www.cvsnt.org/ - - Not a valid comand. - Thanks for using the command line tool. - "; // Get Executable name String filename = Path.Combine (buildDir, "cvs.exe"); --- 207,210 ---- *************** *** 393,397 **** // Check the results of process output ! Assertion.AssertEquals (noOutput, output); } } --- 224,228 ---- // Check the results of process output ! Assertion.AssertEquals (Usage.General + "\r\n", output); } } |