]> git.mdlowis.com Git - archive/dlang.git/commitdiff
Added test file for an option parser
authorMike D. Lowis <mike@mdlowis.com>
Mon, 23 Apr 2012 19:12:23 +0000 (15:12 -0400)
committerMike D. Lowis <mike@mdlowis.com>
Mon, 23 Apr 2012 19:12:23 +0000 (15:12 -0400)
tests/test_options.cpp [new file with mode: 0644]

diff --git a/tests/test_options.cpp b/tests/test_options.cpp
new file mode 100644 (file)
index 0000000..4e6f686
--- /dev/null
@@ -0,0 +1,64 @@
+// Unit Test Framework Includes
+#include "UnitTest++.h"
+
+// Supporting Includes
+#include <sstream>
+#include "exception.h"
+#include "ivisitor.h"
+
+// File To Test
+#include "dlparser.h"
+
+using namespace UnitTest;
+
+//-----------------------------------------------------------------------------
+// Option Parsing Implementation
+//-----------------------------------------------------------------------------
+void parse_options(int argc, char* argv[])
+{
+    //int i;
+    //for(i = 0; i < argc; i++)
+    //{
+    //    int len = strlen( argv[i] );
+    //    if( (len >= 2) && (argv[0] == '-') && (argv[1] == '-') )
+    //    {
+    //        // Parse name
+    //        // if expecting param
+    //        //      consume the =
+    //        //      parse param
+    //        //      call callback
+    //        //  endif
+    //    }
+    //    else if( (len >= 1) && (argv[0] == '-') )
+    //    {
+    //        // Parse name
+    //        // if expecting param
+    //        //      parse param
+    //    }
+    //    else
+    //    {
+    //    }
+    //}
+}
+
+//-----------------------------------------------------------------------------
+// Helper Functions
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// Begin Unit Tests
+//-----------------------------------------------------------------------------
+namespace {
+    //-------------------------------------------------------------------------
+    // Test Parsing of Data Type Literals
+    //-------------------------------------------------------------------------
+    TEST(Parse_An_Empty_Vector)
+    {
+        //char* options[] = {
+        //    (char*) "asd",
+        //    (char*) "-A",
+        //    (char*) "--foo"
+        //};
+        //parse_options(3,options);
+    }
+}