Skip to content

Commit

Permalink
Merge pull request ChrisMarinos#6 from scitesy/fsharp
Browse files Browse the repository at this point in the history
Add more tests to the About strings koan
  • Loading branch information
ChrisMarinos committed May 1, 2012
2 parents 062298c + ad5baab commit a8c84e4
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion FSharpKoans/AboutStrings.fs
Expand Up @@ -3,6 +3,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
Expand All @@ -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.