CmdLineParserTest.st
branchjv
changeset 19988 148721e96482
parent 18120 e3a375d5f6a8
child 20076 ff2f4d06a2fa
--- a/CmdLineParserTest.st	Fri Jun 10 12:48:53 2016 +0100
+++ b/CmdLineParserTest.st	Tue Jun 14 07:04:34 2016 +0100
@@ -1,3 +1,14 @@
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
 "{ Package: 'stx:libbasic' }"
 
 "{ NameSpace: Smalltalk }"
@@ -9,6 +20,21 @@
 	category:'System-Support-Command line'
 !
 
+!CmdLineParserTest class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+! !
 
 !CmdLineParserTest class methodsFor:'queries'!
 
@@ -188,6 +214,32 @@
     self assert: rest asArray = #('/tmp/abc.txt')
 
     "Created: / 08-06-2009 / 14:52:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+test_10
+    | option |
+
+    option := CmdLineOption new spec:$a.
+    self assert: option short == $a.
+    self assert: option long isNil.
+
+    option := CmdLineOption new spec:'-a'.
+    self assert: option short == $a.
+    self assert: option long isNil.
+
+    option := CmdLineOption new spec:'add'.
+    self assert: option short isNil.
+    self assert: option long = 'add'.
+
+    option := CmdLineOption new spec:'--add'.
+    self assert: option short isNil.
+    self assert: option long = 'add'.
+
+    option := CmdLineOption new spec:#('-a' '--add').
+    self assert: option short == $a.
+    self assert: option long = 'add'.
+
+    "Created: / 14-06-2016 / 06:58:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CmdLineParserTest class methodsFor:'documentation'!