Fossil

Check-in [d43165418c]
Login

Check-in [d43165418c]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add some test cases
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | mingw-broken-cmdline
Files: files | file ages | folders
SHA1: d43165418ce3639eec4f390d9efdcd8830d22088
User & Date: jan.nijtmans 2012-09-10 08:21:28.048
Context
2012-09-11
11:57
Merge the latest trunk changes and the mingw-broken-cmdline branch into unicode-cmdline. ... (Closed-Leaf check-in: b19ef490fd user: drh tags: unicode-cmdline)
2012-09-10
08:21
Add some test cases ... (Closed-Leaf check-in: d43165418c user: jan.nijtmans tags: mingw-broken-cmdline)
2012-09-09
22:06
Reformat the windows command-line parser to following the Fossil style. Use the alternative command-line parser on all windows builds, not just for MinGW builds, to simplify the logic and so that the alternative parser code is testing more heavily. ... (check-in: f575af97b2 user: drh tags: mingw-broken-cmdline)
Changes
Unified Diff Ignore Whitespace Patch
Added test/cmdline.test.




























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# Copyright (c) 2011 D. Richard Hipp
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
#
# Author contact information:
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
############################################################################
#
# Test command line parsing
#

proc cmd-line {testname args} {
  set i 1
  foreach {cmdline result} $args {
    fossil test-echo {*}$cmdline
    test cmd-line-$testname.$i {[lrange [split $::RESULT \n] 2 end]=="\{argv\[2\] = \[$result\]\}"}
    incr i
  }
}
cmd-line 100 abc abc {"abc"} abc
cmd-line 101 * {*} *.* {*.*}