forked from jkvor/emongo
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the path to escript in 006-multiup.t.
Signed-off-by: François de Metz <fdemetz@af83.com>
- Loading branch information
1 parent
4e1d0c5
commit e3bfd23
Showing
1 changed file
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
#!/usr/local/bin/escript | ||
#!/usr/bin/env escript | ||
%% -*- erlang -*- | ||
%%! -pa ebin -sasl errlog_type error -boot start_sasl -noshell -config priv/example | ||
|
||
main(_) -> | ||
etap:plan(unknown), | ||
error_logger:tty(false), | ||
etap_application:start_ok(emongo, "application 'emongo' started ok"), | ||
|
||
emongo:delete(test1, "sushi"), | ||
etap:is(emongo:find_all(test1, "sushi"), [], "sushi collection is empty"), | ||
|
||
[emongo:insert(test1, "sushi", [{<<"rolls">>, I}]) || I <- lists:seq(1, 50)], | ||
|
||
(fun() -> | ||
emongo:update(test1, "sushi", [{<<"rolls">>, [{gt, 45}]}], [{<<"$set">>, [{<<"rolls">>, 100}]}], false, true), | ||
Docs = emongo:find_all(test1, "sushi", [{<<"rolls">>, 100}], []), | ||
etap:is(length(Docs), 5, "correct number of results after multiupdate"), | ||
etap:is([I || [_, {_, I}] <- Docs], [100,100,100,100,100], "correct results after multiupdate"), | ||
ok | ||
emongo:update(test1, "sushi", [{<<"rolls">>, [{gt, 45}]}], [{<<"$set">>, [{<<"rolls">>, 100}]}], false, true), | ||
Docs = emongo:find_all(test1, "sushi", [{<<"rolls">>, 100}], []), | ||
etap:is(length(Docs), 5, "correct number of results after multiupdate"), | ||
etap:is([I || [_, {_, I}] <- Docs], [100,100,100,100,100], "correct results after multiupdate"), | ||
ok | ||
end)(), | ||
|
||
etap:end_tests(). |