You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Changed `assert_eq!` tests to `assert!` to fix the build.
* Added semicolons to last line of functions to make pedantic clippy happy.
* Changed explicit impl of Default for timetoken.rs to be derived instead.
* Refactored assertion in subscription.rs to make clippy happy.
* Allowing unknown lints so that the build can pass. Older versions use `broken_intra_doc_links` and newer ones use `rustdoc::broken_intra_doc_links`, so the build fails on one or the other, so allowing unknown lints for now.
* Formatting to make the linter happy.
* Allowing unused async, because it's required for `ControlOutcome`, but Clippy insists it isn't.
* Resolving issues detected by Clippy: "expression borrows a reference...that is immediately dereferenced by the compiler"
* Bumping minimum version to Rust 1.49.0 due to:
- rust-lang/rust#55002
- rust-lang/rust#70921
* Added TODOs to remove linter allows for unknown, renamed, and removed lints when Rust 1.59.0 becomes minimum version.
* Added todo where the default UUID behavior is specified.
Copy file name to clipboardexpand all lines: pubnub-core/src/data/channel/wildcard_spec.rs
+14-14
Original file line number
Diff line number
Diff line change
@@ -130,18 +130,18 @@ mod tests {
130
130
131
131
#[test]
132
132
fnvalid(){
133
-
assert_eq!(is_valid("stocks.*"),true);// from https://support.pubnub.com/support/solutions/articles/14000043663-how-do-i-subscribe-to-a-wildcard-channel-
134
-
assert_eq!(is_valid(""),true);
133
+
assert!(is_valid("stocks.*"));// from https://support.pubnub.com/support/solutions/articles/14000043663-how-do-i-subscribe-to-a-wildcard-channel-
134
+
assert!(is_valid(""));
135
135
}
136
136
137
137
#[test]
138
138
fnvalid_from_docs(){
139
139
// From https://support.pubnub.com/support/solutions/articles/14000043664-how-many-channel-segments-are-supported-with-wildcard-subscribe-
140
140
141
-
assert_eq!(is_valid("a.*"),true);
142
-
assert_eq!(is_valid("a.b.*"),true);
143
-
assert_eq!(is_valid("a.b"),true);
144
-
assert_eq!(is_valid("a.b.c"),true);
141
+
assert!(is_valid("a.*"));
142
+
assert!(is_valid("a.b.*"));
143
+
assert!(is_valid("a.b"));
144
+
assert!(is_valid("a.b.c"));
145
145
146
146
// Technically speaking, the last two examples are just single channels
147
147
// without any wildcards, but you can subscribe to any of the above
@@ -152,12 +152,12 @@ mod tests {
152
152
fninvalid_incorrect_from_docs(){
153
153
// From https://support.pubnub.com/support/solutions/articles/14000043664-how-many-channel-segments-are-supported-with-wildcard-subscribe-
154
154
155
-
assert_eq!(is_valid("*"),false);// can not wildcard at the top level to subscribe to all channels
156
-
assert_eq!(is_valid(".*"),false);// can not start with a .
157
-
assert_eq!(is_valid("a.*.b"),false);// * must be at the end
158
-
assert_eq!(is_valid("a."),false);// the . must be followed by a * when it is at the end of the name
159
-
assert_eq!(is_valid("a*"),false);// * must always be preceded with a .
160
-
assert_eq!(is_valid("a*b"),false);// * must always be preceded with a . and .* must always be at the end
155
+
assert!(!is_valid("*"));// can not wildcard at the top level to subscribe to all channels
156
+
assert!(!is_valid(".*"));// can not start with a .
157
+
assert!(!is_valid("a.*.b"));// * must be at the end
158
+
assert!(!is_valid("a."));// the . must be followed by a * when it is at the end of the name
159
+
assert!(!is_valid("a*"));// * must always be preceded with a .
160
+
assert!(!is_valid("a*b"));// * must always be preceded with a . and .* must always be at the end
161
161
162
162
// NOTE: The above invalid channel names will actually succeed if you
163
163
// attempt to subscribe to them. They will even succeed when you publish
@@ -182,8 +182,8 @@ mod tests {
182
182
// two . characters (more than three segments) it will succeed, but
183
183
// you will not be able to publish to those channels.
184
184
185
-
assert_eq!(is_valid("a.b.c.d"),false);// too many segments
186
-
assert_eq!(is_valid("a.b.c.*"),false);// too many segments
185
+
assert!(!is_valid("a.b.c.d"));// too many segments
186
+
assert!(!is_valid("a.b.c.*"));// too many segments
187
187
188
188
// If you do attempt to publish to channel names with more than three
189
189
// segments (three or more . delimiters), then you will receive a 400
0 commit comments