Permalink
Browse files

Merge pull request #6 from scitesy/fsharp

Add more tests to the About strings koan
  • Loading branch information...
2 parents 062298c + ad5baab commit a8c84e4ed9d288514aa51ca1e136c1aa2c14bf91 @ChrisMarinos committed May 1, 2012
Showing with 44 additions and 1 deletion.
  1. +44 −1 FSharpKoans/AboutStrings.fs
@@ -4,6 +4,18 @@ open FSharpKoans.Core
type ``about strings``() =
[<Koan>]
+ member this.StringValue() =
+ let message = "hello"
+
+ AssertEquality message __
+
+ [<Koan>]
+ member this.StringConcatValue() =
+ let message = "hello " + "world"
+
+ AssertEquality message __
+
+ [<Koan>]
member this.FormattingStringValues() =
let message = sprintf "F# turns it to %d!" 11
@@ -27,4 +39,35 @@ type ``about strings``() =
AssertEquality message __
(* NOTE: For all the %formatters that you can use with string formatting
- see: http://msdn.microsoft.com/en-us/library/ee370560.aspx *)
+ see: http://msdn.microsoft.com/en-us/library/ee370560.aspx *)
+
+ [<Koan>]
+ member this.CombineMultiline() =
+ let message = "super\
+ cali\
+ fragilistic\
+ expiali\
+ docious"
+
+ AssertEquality message __
+
+ [<Koan>]
+ member this.Multiline() =
+ let message = "This
+ is
+ on
+ five
+ lines"
+
+ AssertEquality
+ message __
+
+ [<Koan>]
+ member this.ExtractValues() =
+ let message = "hello world"
+
+ let first = message.[0]
+ let other = message.[4]
+
+ AssertEquality first __
+ AssertEquality other __

0 comments on commit a8c84e4

Please sign in to comment.