-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Room version 6 tests #869
Merged
Merged
Room version 6 tests #869
Changes from 10 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
79ac786
Add a test-case for invalid JSON (integers out of range).
clokep 695dfcb
Specify the room version.
clokep d80cb4b
Add tests for floats.
clokep 65855e0
Switch to room version 6 instead of experimental version.
clokep d10ad89
Add version 6.
clokep dbc682a
Add a test for asserting the notifications power levels of room ver 6.
clokep e75245c
POST not PUT
clokep 972e60b
Properly send infinity / NaN from Perl.
clokep 727e23f
Fix typo.
clokep 18e664a
Merge remote-tracking branch 'origin/develop' into clokep/room-ver-6
clokep 82ae5cd
Clarify that invalid values aren't even JSON.
clokep 459d9e0
Remove erronously added import.
clokep 4e65103
Send join tests.
clokep d8eaaf8
Add a test for send invite.
clokep ee7c457
Reject a v6 room invite successfully.
clokep 3df4a73
Test send_leave with bad JSON.
clokep 5054240
Add a test for bad data in the return to make_invite.
clokep 82907bc
Abstract the code that checks for a bad JSON return code.
clokep 5bab21c
Add tests for /send API with bad JSON.
clokep c4aa0ee
Partially roll-back the JSON checks.
clokep 9194474
Ensure a bad event doesn't come do backfill.
clokep d4340b6
Add a passing test for get_missing_events.
clokep 2e6e10d
Modify the test to have bad JSON.
clokep 11f68ec
Remove unused variables.
clokep ed08c3b
Merge branch 'develop' into clokep/room-ver-6
clokep 6663e5d
Move helper for checking for a bad JSON value.
clokep fa8ce9c
Remove with_events option.
clokep 0dd8fa3
Clarify the get_missing_events test.
clokep ee89a40
Unique room alias.
clokep a17a675
Consistently use Future->done.
clokep 4e582a8
Remove duplicate checks.
clokep 9ab4878
Add comments.
clokep f3d5574
Use federated_rooms_fixture.
clokep 0aebc56
Use matrix_join_room.
clokep 1238be2
Switch to matrix_join_room_synced.
clokep a49a240
Fix typos
clokep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Test integers that are outside of the range of [-2 ^ 53 + 1, 2 ^ 53 - 1]. | ||
test "Invalid JSON integers", | ||
requires => [ local_user_and_room_fixtures( | ||
room_opts => { room_version => "6" } | ||
), ], | ||
|
||
do => sub { | ||
my ( $user, $room_id ) = @_; | ||
|
||
Future->needs_all( | ||
do_request_json_for( $user, | ||
method => "POST", | ||
uri => "/r0/rooms/$room_id/send/sytest.dummy", | ||
content => { | ||
msgtype => "sytest.dummy", | ||
body => 9007199254740992, # 2 ** 53 | ||
}, | ||
)->followed_by( \&main::expect_http_400 ), | ||
|
||
do_request_json_for( $user, | ||
method => "POST", | ||
uri => "/r0/rooms/$room_id/send/sytest.dummy", | ||
content => { | ||
msgtype => "sytest.dummy", | ||
body => -9007199254740992, # -2 ** 53 | ||
}, | ||
)->followed_by( \&main::expect_http_400 ), | ||
); | ||
}; | ||
|
||
# Floats (including NaN, Infinity, and -Infinity) should be rejected. | ||
test "Invalid JSON floats", | ||
requires => [ local_user_and_room_fixtures( | ||
room_opts => { room_version => "6" } | ||
), ], | ||
|
||
do => sub { | ||
my ( $user, $room_id ) = @_; | ||
|
||
Future->needs_all( | ||
do_request_json_for( $user, | ||
method => "POST", | ||
uri => "/r0/rooms/$room_id/send/sytest.dummy", | ||
content => { | ||
msgtype => "sytest.dummy", | ||
body => 1.1, | ||
}, | ||
)->followed_by( \&main::expect_http_400 ), | ||
|
||
do_request_json_for( $user, | ||
method => "POST", | ||
uri => "/r0/rooms/$room_id/send/sytest.dummy", | ||
content => { | ||
msgtype => "sytest.dummy", | ||
body => "NaN" + 0, | ||
}, | ||
)->followed_by( \&main::expect_http_400 ), | ||
|
||
do_request_json_for( $user, | ||
method => "POST", | ||
uri => "/r0/rooms/$room_id/send/sytest.dummy", | ||
content => { | ||
msgtype => "sytest.dummy", | ||
body => "inf" + 0, | ||
}, | ||
)->followed_by( \&main::expect_http_400 ), | ||
|
||
do_request_json_for( $user, | ||
method => "POST", | ||
uri => "/r0/rooms/$room_id/send/sytest.dummy", | ||
content => { | ||
msgtype => "sytest.dummy", | ||
body => "-inf" + 0, | ||
}, | ||
)->followed_by( \&main::expect_http_400 ), | ||
); | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This room version was previously removed from Synapse, it also seems a bit weird to bit unstable room versions in here.