Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/account.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let create () = 0

let balance account = account

let deposit amount account =
let deposit amount account =
match amount with
| neg when amount < 0 ->
invalid_arg (Printf.sprintf "Cannot deposit a negative amount: %d" amount)
Expand Down
6 changes: 3 additions & 3 deletions examples/account_spec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ let specs = [
];
describe "that is negative" [
it "fails" begin
expect
(fun _ -> Account.deposit (-1) empty)
expect
(fun _ -> Account.deposit (-1) empty)
(raise_exn (Invalid_argument "Cannot deposit a negative amount: -1"))
end
];
Expand All @@ -53,7 +53,7 @@ let specs = [
];
describe "and more than the current balance" [
it "fails" begin
expect
expect
(fun _ -> Account.withdraw 50 empty)
(raise_exn (Account.Insufficient_funds 0))
end;
Expand Down
2 changes: 1 addition & 1 deletion jospecl_server
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let spec_file_runner verbose =
let specs = specs_of_file spec_file in
Ospecl.Spec.Exec.execute [send_back] specs;
reply to run_spec_file
in
in
run_spec_file

let _ =
Expand Down
4 changes: 2 additions & 2 deletions ospecl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let specs_of_file filename =
failwith (sprintf "Could not use file %s" filename)

let _ =
let usage_message =
let usage_message =
let this_file = (Filename.basename Sys.argv.(0)) in
sprintf "$ %s [options] [spec files]\n" this_file in

Expand All @@ -40,7 +40,7 @@ let _ =
("d", Ospecl.Handlers.Terminal.documentation);
("doc", Ospecl.Handlers.Terminal.documentation);
("documentation", Ospecl.Handlers.Terminal.documentation);
]
]
in
let choose_format f =
formatter := List.assoc f formatters
Expand Down
4 changes: 2 additions & 2 deletions src/matchers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let is_some matcher =
let whose describe_with transform matcher =
let description = describe_with (description_of matcher) in
let test actual =
match check (transform actual) matcher with
match check (transform actual) matcher with
| Matched actual -> Matched (describe_with actual)
| Mismatched actual -> Mismatched (describe_with actual)
in make description test
Expand Down Expand Up @@ -68,7 +68,7 @@ let false' = equal_to_bool false

let equal_to_option string_of_item =
let string_of_option = function
| None -> "None"
| None -> "None"
| Some item -> "Some (" ^ string_of_item item ^ ")"
in
equal_to string_of_option
Expand Down
2 changes: 1 addition & 1 deletion src/spec.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ val expect : 'a -> 'a Matcher.t -> expectation
val (=~) : 'a -> 'a Matcher.t -> expectation
val pending : string -> expectation

(* Filters a list of specs, removing:
(* Filters a list of specs, removing:
* all examples whose description does not match the regex
* all groups which do not contain any matching examples
*)
Expand Down
2 changes: 1 addition & 1 deletion test/test_client_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $client
echo '=== 1 server 1 spec ==='
$client -color -address 127.0.0.1:7000 $(pwd)/examples/account_spec.ml
echo '=== 2 servers 1 spec ==='
$client -color -address 127.0.0.1:7000 -address 127.0.0.1:7000 $(pwd)/examples/account_spec.ml
$client -color -address 127.0.0.1:7000 -address 127.0.0.1:7000 $(pwd)/examples/account_spec.ml
echo '=== 1 server 2 specs ==='
$client -color -address 127.0.0.1:7000 $(pwd)/examples/account_spec.ml $(pwd)/examples/account_spec.ml
echo '=== 2 servers 2 specs ==='
Expand Down
4 changes: 2 additions & 2 deletions test/test_spec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ let test_exec =
]
]
in
let expected_events =
let open Exec in
let expected_events =
let open Exec in
[
Execution_started;
Group_started ["1"];
Expand Down