Browse Source

Added bx::CommandLine test.

Branimir Karadžić 11 years ago
parent
commit
22c812b11e
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tests/tokenizecmd.cpp

+ 18 - 0
tests/tokenizecmd.cpp

@@ -5,8 +5,26 @@
 
 #include "test.h"
 #include <bx/tokenizecmd.h>
+#include <bx/commandline.h>
 #include <string.h>
 
+TEST(commandLine)
+{
+	const char* args[] =
+	{
+		"-s"
+		"--long",
+	};
+
+	bx::CommandLine cmdLine(BX_COUNTOF(args), args);
+
+	CHECK(NULL != cmdLine.findOption("long") );
+	CHECK(NULL != cmdLine.findOption('s') );
+
+	// non-existing argument
+	CHECK(NULL == cmdLine.findOption('x') );
+}
+
 TEST(tokenizeCommandLine)
 {
 #if 0