<commit_before>add_dependencies({
    util: 'js/util.js',
    stream_data: 'js/stream_data.js'
});

set_global('page_params', {
    email: '<EMAIL>',
    domain: 'zulip.com'
});

set_global('feature_flags', {});

var Filter = require('js/filter.js');
var _ = global._;

function assert_same_operators(result, terms) {
    terms = _.map(result, function (term) {
        // If negated flag is undefined, we explicitly
        // set it to false.
        var negated = term.negated;
        if (!negated) {
            negated = false;
        }
        return {
            negated: negated,
            operator: term.operator,
            operand: term.operand
        };
    });
    assert.deepEqual(result, terms);
}
<commit_msg>Fix false positives in assert_same_operators in filter tests.<commit_after>add_dependencies({
    util: 'js/util.js',
    stream_data: 'js/stream_data.js'
});

set_global('page_params', {
    email: '<EMAIL>',
    domain: 'zulip.com'
});

set_global('feature_flags', {});

var Filter = require('js/filter.js');
var _ = global._;

function assert_same_operators(result, terms) {
    terms = _.map(terms, function (term) {
        // If negated flag is undefined, we explicitly
        // set it to false.
        var negated = term.negated;
        if (!negated) {
            negated = false;
        }
        return {
            negated: negated,
            operator: term.operator,
            operand: term.operand
        };
    });
    assert.deepEqual(result, terms);
}

{'fraction_non_alphanumeric': 0.1356717405691595, 'fraction_numerical': 0.0, 'mean_word_length': 2.308533916849015, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4652780', 'n_tokens_mistral': 477, 'n_tokens_neox': 476, 'n_words': 107}