diff options
| author | Steven Knight <knight@baldmt.com> | 2004-04-03 07:47:40 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2004-04-03 07:47:40 (GMT) |
| commit | e3395e16f968f033c77090aa8b4212c0f89ebf6a (patch) | |
| tree | 07a84c902f1d074daa9914244bf8546ce7917596 /test | |
| parent | fd66a638d425a722b4e84b57d7a40860d06c9d49 (diff) | |
| download | SCons-e3395e16f968f033c77090aa8b4212c0f89ebf6a.zip SCons-e3395e16f968f033c77090aa8b4212c0f89ebf6a.tar.gz SCons-e3395e16f968f033c77090aa8b4212c0f89ebf6a.tar.bz2 | |
Put the --duplicate option in alphabetical order in the help output.
Diffstat (limited to 'test')
| -rw-r--r-- | test/option--H.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/option--H.py b/test/option--H.py index 5cf9ab7..0cf3b2b 100644 --- a/test/option--H.py +++ b/test/option--H.py @@ -24,10 +24,12 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import TestSCons +import copy import string import sys +import TestSCons + test = TestSCons.TestSCons() test.write('SConstruct', "") @@ -37,5 +39,18 @@ test.run(arguments = '-H') test.fail_test(string.find(test.stdout(), '-H, --help-options') == -1) test.fail_test(string.find(test.stdout(), '--debug=TYPE') == -1) +# Validate that the help output lists the options in case-insensitive +# alphabetical order. +lines = string.split(test.stdout(), '\n') +lines = filter(lambda x: x[:3] == ' -', lines) +lines = map(lambda x: x[3:], lines) +lines = map(lambda x: x[0] == '-' and x[1:] or x, lines) +options = map(lambda x: string.split(x)[0], lines) +options = map(lambda x: x[-1] == ',' and x[:-1] or x, options) +lowered = map(lambda x: string.lower(x), options) +sorted = copy.copy(lowered) +sorted.sort() +test.fail_test(lowered != sorted) + test.pass_test() |
