nickva commented on code in PR #5603:
URL: https://github.com/apache/couchdb/pull/5603#discussion_r2307705188
##########
src/chttpd/test/eunit/chttpd_changes_test.erl:
##########
@@ -493,6 +495,97 @@ t_docs_id_filter_over_limit({_, DbUrl}) ->
Rows
).
+t_time_since({_, DbUrl}) ->
+ % Far into the future, we should get nothing
+ Params1 = "?since=3000-02-03T04:05:00Z",
+ {Seq1, Pending1, Rows1} = changes(DbUrl, Params1),
+ ?assertEqual(8, Seq1),
+ ?assertEqual(0, Pending1),
+ ?assertEqual([], Rows1),
+
+ % Before the feature is released, should same as since=0
+ Params2 = "?since=2025-01-01T04:05:00Z",
+ Res2 = {Seq2, Pending2, Rows2} = changes(DbUrl, Params2),
+ ?assertEqual(8, Seq2),
+ ?assertEqual(0, Pending2),
+ ?assertEqual(
+ [
+ {6, {?DOC1, <<"2-c">>}, ?LEAFREV},
+ {7, {?DOC3, <<"2-b">>}, ?DELETED},
+ {8, {?DDOC2, <<"2-c">>}, ?LEAFREV}
+ ],
+ Rows2
+ ),
+ % Verify we're getting the same results as since=0
+ ?assertEqual(Res2, changes(DbUrl, "?since=0")),
Review Comment:
Ooh that's great idea, I had no idea about those. Thanks for the tip, I'll
some into the tests!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]