Permalink
Browse files

fixing missing checking that got clobbered by Live Mesh

  • Loading branch information...
1 parent 515dcf1 commit dfef9256be51ba71ee0f301f2244a99d946d4bee Harry Pierson committed Jul 28, 2008
View
@@ -0,0 +1,4 @@
+*.dll
+*.pdb
+*.exe
+*.suo
@@ -0,0 +1,64 @@
+"General"
+{
+"ProjectIdGuid" = "{B07E7515-ABC3-4491-8EC0-BA4C8E6A6C3C}"
+}
+"Configurations"
+{
+ "Debug|Win32"
+ {
+ "ProjectType" = "DLL"
+ "OptLevel" = "Off"
+ "StrongNamingLevel" = "None"
+ "OutputPath" = ""
+ "SearchPath" = "-R \"..\\..\\External\\xunit.dll\" -R \"..\\..\\External\\FsTest.dll\" -R \"D:\\HPierson.Files\\Projects\\Quinault\\Cashel\\Cashel\\cashel.dll\""
+ "StrongNameFile" = ""
+ "OutputBase" = ""
+ "CustomCommandLine" = ""
+ "CustomCompiler" = ""
+ "DebugCheck" = "TRUE"
+ "CustomCompilationCheck" = "FALSE"
+ "DebugStartMode" = "0"
+ "StartApp" = "D:\\HPierson.Files\\Projects\\Quinault\\External\\xunit.console.exe"
+ "StartAppPath" = ""
+ "CustomStartupArguments" = "cashel.tests.dll /wait "
+ }
+ "Release|Win32"
+ {
+ "ProjectType" = "DLL"
+ "OptLevel" = "3"
+ "StrongNamingLevel" = "None"
+ "OutputPath" = ""
+ "SearchPath" = "-I \"..\\..\\External\" -R \"xunit.dll\" -R \"FsUtil.dll\""
+ "StrongNameFile" = ""
+ "OutputBase" = ""
+ "CustomCommandLine" = ""
+ "CustomCompiler" = ""
+ "DebugCheck" = "FALSE"
+ "CustomCompilationCheck" = "FALSE"
+ "DebugStartMode" = "0"
+ "StartApp" = ""
+ "StartAppPath" = ""
+ "CustomStartupArguments" = ""
+ }
+}
+"Files"
+{
+ "parser.tests.fs"
+ {
+ "ProjRelPath" = "T"
+ }
+ "primitives.test.fs"
+ {
+ "ProjRelPath" = "T"
+ }
+ "peg.test.fs"
+ {
+ "ProjRelPath" = "T"
+ }
+}
+"ProjStartupServices"
+{
+}
+"Globals"
+{
+}
@@ -0,0 +1,3 @@
+// Turn on the lightweight syntax
+#light
+
@@ -0,0 +1,61 @@
+// Turn on the lightweight syntax
+#light
+
+open Xunit
+open FsxUnit.Syntax
+
+open DevHawk.Parser.Core
+
+let (!!) str = List.of_seq str
+let hello = !!"hello"
+
+[<Fact>]
+let test_result () =
+ result 1 "hello" |> should equal (Some(1,"hello"))
+
+[<Fact>]
+let test_zero () =
+ zero "hello" |> should equal None
+
+[<Fact>]
+let test_bind () =
+ let p1 = fun input -> Some(2,input)
+ let p2 x = fun input -> Some(5*x,input)
+ let p3 = p1 >>= p2
+ p3 "hello" |> should equal (Some(10, "hello"))
+
+[<Fact>]
+let test_combine_both_work () =
+ let p1 = fun input -> Some(1,input)
+ let p2 = fun input -> Some(2,input)
+ let p3 = p1 +++ p2
+ p3 "hello" |> should equal (Some(1, "hello"))
+
+[<Fact>]
+let test_combine_second_Fails () =
+ let p1 = fun input -> Some(1,input)
+ let p3 = p1 +++ zero
+ p3 "hello" |> should equal (Some(1, "hello"))
+
+[<Fact>]
+let test_combine_first_fails () =
+ let p1 = fun input -> Some(1,input)
+ let p3 = zero +++ p1
+ p3 "hello" |> should equal (Some(1, "hello"))
+
+[<Fact>]
+let test_combine_both_fail () =
+ let p3 = zero +++ zero
+ p3 "hello" |> should equal None
+
+
+//result a >>= f == f a
+//p >>= result == p
+//p >>= (fun a -> (f a >>= g)) == (p >>= (fun a -> f a)) >>= g
+
+
+
+
+(*[<Fact>]
+let test_str () =
+ token !!"test" !!"testing" |> should equal (Some((), !!"ing"))*)
Oops, something went wrong. Retry.

0 comments on commit dfef925

Please sign in to comment.