<commit_before>/// <reference path="../../testsuite/tsUnit.ts"/>
/// <reference path="../../js/dolphin/ClientAttribute.ts"/>
/// <reference path="../../js/dolphin/ClientPresentationModel.ts"/>


module opendolphin {
    export class ClientAttributeTests extends tsUnit.TestClass {

        attributesShouldGetUniqueIds() {
            var ca1 = new ClientAttribute("prop","qual","tag");
            var ca2 = new ClientAttribute("prop","qual","tag");
            this.areNotIdentical(ca1.id, ca2.id);
        }

        valueListenersAreCalled() {
            var attr = new ClientAttribute("prop", "qual", 0);

            var spoofedOld = -1;
            var spoofedNew = -1;
            attr.onValueChange( (evt: ValueChangedEvent) => {
                spoofedOld = evt.oldValue;
                spoofedNew = evt.newValue;
            } )

            this.areIdentical(spoofedOld, 0)
            this.areIdentical(spoofedNew, 0)

            attr.setValue(1);

            this.areIdentical(spoofedOld, 0)
            this.areIdentical(spoofedNew, 1)

        }

        attributeListenersAreCalled() {
            var attr = new ClientAttribute("prop", "qual", 0);

            var spoofedOldQfr;
            var spoofedNewQfr;
            attr.onQualifierChange((evt:ValueChangedEvent) => {
                spoofedOldQfr = evt.oldValue;
                spoofedNewQfr = evt.newValue;
            })
            attr.setQualifier("qual_change");<commit_msg>try build to fail<commit_after>/// <reference path="../../testsuite/tsUnit.ts"/>
/// <reference path="../../js/dolphin/ClientAttribute.ts"/>
/// <reference path="../../js/dolphin/ClientPresentationModel.ts"/>


module opendolphin {
    export class ClientAttributeTests extends tsUnit.TestClass {

        attributesShouldGetUniqueIds() {
            var ca1 = new ClientAttribute("prop","qual","tag");
            var ca2 = new ClientAttribute("prop","qual","tag");
            this.areNotIdentical(ca1.id, ca2.id);
        }

        valueListenersAreCalled() {
            var attr = new ClientAttribute("prop", "qual", 0);

            var spoofedOld = -1;
            var spoofedNew = -1;
            attr.onValueChange( (evt: ValueChangedEvent) => {
                spoofedOld = evt.oldValue;
                spoofedNew = evt.newValue;
            } )

            this.areIdentical(spoofedOld, 0)
            this.areIdentical(spoofedNew, 0)

            attr.setValue(1);

            this.areIdentical(spoofedOld, 55)
            this.areIdentical(spoofedNew, 1)

        }

        attributeListenersAreCalled() {
            var attr = new ClientAttribute("prop", "qual", 0);

            var spoofedOldQfr;
            var spoofedNewQfr;
            attr.onQualifierChange((evt:ValueChangedEvent) => {
                spoofedOldQfr = evt.oldValue;
                spoofedNewQfr = evt.newValue;
            })
            attr.setQualifier("qual_change");
{'fraction_non_alphanumeric': 0.12777587974034849, 'fraction_numerical': 0.009224461906388794, 'mean_word_length': 1.9221556886227544, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '16270', 'n_tokens_mistral': 869, 'n_tokens_neox': 835, 'n_words': 144}