mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Add tests
This commit is contained in:
3 files changed
+1232
-706
No files matched your search
@@ -114,12 +114,13 @@ export class SubscriptionFilters {
|
||||
* Subtracting a filter accepting all produces an empty filter.
|
||||
*/
|
||||
subtract(other: this) {
|
||||
if (this._all) {
|
||||
return; // Cannot subtract from all
|
||||
}
|
||||
if (other._all) {
|
||||
this._all = false;
|
||||
this._filters.clear();
|
||||
return;
|
||||
}
|
||||
if (this._all) {
|
||||
return; // Cannot subtract from all
|
||||
}
|
||||
for (const filter of other._filters) {
|
||||
this._filters.delete(filter);
|
||||
@@ -366,6 +367,7 @@ export class SubscriptionController {
|
||||
} else {
|
||||
subscriber.filters = request.filters;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error(`unreachable case: ${String(request.action)}`);
|
||||
|
||||
Reference in new issue
Block a user