[from now] 2013/07/20 20:52:58

diff --git a/MyOMake b/MyOMake
index 15057c9..f5fbfc3 160000
--- a/MyOMake
+++ b/MyOMake
@@ -1 +1 @@
-Subproject commit 15057c910ddbcaac0e66d34cda78746b6fbbd31c
+Subproject commit f5fbfc3e27c9338f98b4793576efed2c935f1e96
diff --git a/src/option.ml b/src/option.ml
index 3a6c4b3..d47173a 100644
--- a/src/option.ml
+++ b/src/option.ml
@@ -14,6 +14,14 @@ let is_some = function
   | Some _ -> true
   | _ -> false

+let get = function
+  | Some v -> v
+  | None -> invalid_arg "argument must be None."
+
+let get_default ~default = function
+  | Some v -> v
+  | None -> default
+
 let compare_with ?(comparator=compare) fst snd =
   match (fst, snd) with
   | None, None -> 0
diff --git a/src/option.mli b/src/option.mli
index 576c4e2..d63654d 100644
--- a/src/option.mli
+++ b/src/option.mli
@@ -23,6 +23,12 @@ val is_none : 'a option -> bool
 (** return true if given option is Some and some value. *)
 val is_some : 'a option -> bool

+(** return value getting from Some. Raise Invalid_argument if argument is None *)
+val get : 'a option -> 'a
+
+(** return value getting from given option, or default value if given option is None. *)
+val get_default : default:'a -> 'a option -> 'a
+
 (** Compared to between two options with comparator for
     between type variant of type.

diff --git a/test/OMakefile b/test/OMakefile
index 8800a61..2a5a95a 100644
--- a/test/OMakefile
+++ b/test/OMakefile
@@ -89,8 +89,13 @@ OCAML_LIBS += ../src/sugarpot
 #

 # need sdlcaml library
+FILES[] =
+	test_option
+	test_binary_pack
+	test_input
+	sugarpot_tests

-TARGET = $(OCamlProgram sugarpot_tests, $(removesuffix .ml, $(ls *.ml)))
+TARGET = $(OCamlProgram sugarpot_tests, $(FILES))
 .DEFAULT: $(TARGET)

 .PHONY: test
diff --git a/test/sugarpot_tests.ml b/test/sugarpot_tests.ml
index 37e8e23..315ed80 100644
--- a/test/sugarpot_tests.ml
+++ b/test/sugarpot_tests.ml
@@ -3,6 +3,7 @@ open Kaputt.Abbreviations
 let suite = List.concat [
   Test_binary_pack.suite;
   Test_input.suite;
+  Test_option.suite;
 ]

 let () =
Add tests for Option module.
Fixed option_map.
Merge branch 'feature/add-option-test'