<commit_before>exports.execute = function(options) {

    describe('About the Column class, ', function() {
        var schemaName1 = "common_schema_1",
            schemaName2 = "common_schema_2";
        var table1_schema1, // has two outbound fks to table2_schema1. with foreign-key annotation.
            table2_schema1, // has outbound fk to table1_schema2.
            table1_schema2, // doesn't have any outbound foreignkeys. in different schema.
            catalog;

        beforeAll(function(done) {
            catalog = options.catalog;
            table1_schema1 = catalog.schemas.get(schemaName1).tables.get('table_1_schema_1');
            table2_schema1 = catalog.schemas.get(schemaName1).tables.get('table_2_schema_1');
            table1_schema2 = catalog.schemas.get(schemaName2).tables.get('table_1_schema_2');
            done();
        });

        // Test Cases:
        describe('a column in Table class, ', function() {
            var column;
            beforeAll(function() {
                column = table1_schema2.columns.getByPosition(2);
            });

            it('should be defined.', function() {
                expect(column).toBeDefined();
            });

            it('should have a .formatvalue property.', function() {
                expect(column.formatvalue).toBeDefined();
            });

            describe('the .formatvalue property, ', function() {
                var formatUtils = options.includes.ermRest._formatUtils;

                it('should be empty string if column value is null.', function() {
                    var column = table1_schema2.columns.getByPosition(2);
                    expect(column.formatvalue(null)).toEqual(jasmine.any(String));
                    expect(column.formatvalue(null)).toBe('');
                });

                describe('should call printText() to format,', function() {
                    var formattedValue = undefined;

                    it('text columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printText').and.callThrough();
                        var textCol = table1_schema2.columns.getByPosition(2);
                        formattedValue = textCol.formatvalue('text value');
                        expect(spy).toHaveBeenCalledWith('text value', undefined);
                        expect(formattedValue).toBe('text value');
                    });

                    it('longtext columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printText').and.callThrough();
                        var longtextCol = table1_schema2.columns.getByPosition(3);
                        var longtext = 'asjdf;laksjdf;laj ;lkajsd;f lkajsdf;lakjs f;lakjs df;lasjd f;ladsjf;alskdjfa ;lskdjf a;lsdkjf a;lskdfjal;sdkfj as;ldfkj as;dlf kjasl;fkaj;lfkjasl;fjas;ldfkjals;dfkjas;dlkfja;sldkfjasl;dkfjas;dlfkjasl;dfkja; lsdjfk a;lskdjf a;lsdfj as;ldfja;sldkfja;lskjdfa;lskdjfa;lsdkfja;sldkfjas;ldfkjas;dlfkjas;lfkja;sldkjf a;lsjf ;laskj fa;slk jfa;sld fjas;l js;lfkajs;lfkasjf;alsja;lk ;l kja';
                        formattedValue = longtextCol.formatvalue(longtext);
                        expect(spy).toHaveBeenCalledWith(longtext, undefined);
                        expect(formattedValue).toBe(longtext);
                    });

                    afterEach(function() {
                        expect(formattedValue).toEqual(jasmine.any(String));
                        formattedValue = undefined;
                    });
                });

                describe('should call printBoolean() to format,', function() {
                    it('boolean columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printBoolean').and.callThrough();
                        var col = table1_schema2.columns.getByPosition(5);

                        var trueBoolean = col.formatvalue(true);
                        expect(spy).toHaveBeenCalledWith(true, undefined);
                        expect(trueBoolean).toEqual(jasmine.any(String));
                        expect(trueBoolean).toBe('true');

                        var falseBoolean = col.formatvalue(false);
                        expect(spy).toHaveBeenCalledWith(false, undefined);
                        expect(falseBoolean).toEqual(jasmine.any(String));
                        expect(falseBoolean).toBe('false');

                        expect(spy.calls.count()).toBe(2);
                    });
                });

                xdescribe('should call printTimestamp() to format,', function() {
                    it('timestamptz columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printTimestamp').and.callThrough();
                        var col = table1_schema2.columns.getByPosition(6);
                        var formattedValue = col.formatvalue(true);
                        expect(spy).toHaveBeenCalled();
                        expect(formattedValue).toEqual(jasmine.any(String));
                        expect(formattedValue).toBe('true');
                    });
                });

                // describe('should call printDate()')
            });
        });
    });
};<commit_msg>Added specs for timestamp and date columns<commit_after>exports.execute = function(options) {
    var sampleValues = {
        date: '2016-05-02',
        timestamptz: '2011-05-06T08:25:25-07:00'
    };

    describe('About the Column class, ', function() {
        var schemaName1 = "common_schema_1",
            schemaName2 = "common_schema_2";
        var table1_schema1, // has two outbound fks to table2_schema1. with foreign-key annotation.
            table2_schema1, // has outbound fk to table1_schema2.
            table1_schema2, // doesn't have any outbound foreignkeys. in different schema.
            catalog;

        beforeAll(function(done) {
            catalog = options.catalog;
            table1_schema1 = catalog.schemas.get(schemaName1).tables.get('table_1_schema_1');
            table2_schema1 = catalog.schemas.get(schemaName1).tables.get('table_2_schema_1');
            table1_schema2 = catalog.schemas.get(schemaName2).tables.get('table_1_schema_2');
            done();
        });

        // Test Cases:
        describe('a column in Table class, ', function() {
            var column;
            beforeAll(function() {
                column = table1_schema2.columns.getByPosition(2);
            });

            it('should be defined.', function() {
                expect(column).toBeDefined();
            });

            it('should have a .formatvalue property.', function() {
                expect(column.formatvalue).toBeDefined();
            });

            describe('the .formatvalue property, ', function() {
                var formatUtils = options.includes.ermRest._formatUtils;

                it('should be empty string if column value is null.', function() {
                    var column = table1_schema2.columns.getByPosition(2);
                    expect(column.formatvalue(null)).toEqual(jasmine.any(String));
                    expect(column.formatvalue(null)).toBe('');
                });

                describe('should call printText() to format,', function() {
                    var formattedValue = undefined;

                    it('text columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printText').and.callThrough();
                        var textCol = table1_schema2.columns.getByPosition(2);
                        formattedValue = textCol.formatvalue('text value');
                        expect(spy).toHaveBeenCalledWith('text value', undefined);
                        expect(formattedValue).toBe('text value');
                    });

                    it('longtext columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printText').and.callThrough();
                        var longtextCol = table1_schema2.columns.getByPosition(3);
                        var longtext = 'asjdf;laksjdf;laj ;lkajsd;f lkajsdf;lakjs f;lakjs df;lasjd f;ladsjf;alskdjfa ;lskdjf a;lsdkjf a;lskdfjal;sdkfj as;ldfkj as;dlf kjasl;fkaj;lfkjasl;fjas;ldfkjals;dfkjas;dlkfja;sldkfjasl;dkfjas;dlfkjasl;dfkja; lsdjfk a;lskdjf a;lsdfj as;ldfja;sldkfja;lskjdfa;lskdjfa;lsdkfja;sldkfjas;ldfkjas;dlfkjas;lfkja;sldkjf a;lsjf ;laskj fa;slk jfa;sld fjas;l js;lfkajs;lfkasjf;alsja;lk ;l kja';
                        formattedValue = longtextCol.formatvalue(longtext);
                        expect(spy).toHaveBeenCalledWith(longtext, undefined);
                        expect(formattedValue).toBe(longtext);
                    });

                    afterEach(function() {
                        expect(formattedValue).toEqual(jasmine.any(String));
                        formattedValue = undefined;
                    });
                });

                describe('should call printDate() to format,', function() {
                    it('date columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printDate').and.callThrough();
                        var testVal = '2016-05-02 13:00:00.00 PST';
                        var col = table1_schema2.columns.getByPosition(4);
                        var options = {separator: '.', leadingZero: false};
                        var formattedValue = col.formatvalue(testVal, options);
                        expect(spy).toHaveBeenCalledWith(testVal, options);
                        expect(formattedValue).toEqual(jasmine.any(String));
                        expect(formattedValue).toBe('2016.5.2');
                    });
                });

                describe('should call printBoolean() to format,', function() {
                    it('boolean columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printBoolean').and.callThrough();
                        var col = table1_schema2.columns.getByPosition(5);

                        var trueBoolean = col.formatvalue(true);
                        expect(spy).toHaveBeenCalledWith(true, undefined);
                        expect(trueBoolean).toEqual(jasmine.any(String));
                        expect(trueBoolean).toBe('true');

                        var falseBoolean = col.formatvalue(false);
                        expect(spy).toHaveBeenCalledWith(false, undefined);
                        expect(falseBoolean).toEqual(jasmine.any(String));
                        expect(falseBoolean).toBe('false');

                        expect(spy.calls.count()).toBe(2);
                    });
                });

                describe('should call printTimestamp() to format,', function() {
                    it('timestamptz columns correctly.', function() {
                        var spy = spyOn(formatUtils, 'printTimestamp').and.callThrough();
                        var testVal = '2011-05-06T08:25:25-07:00';
                        var col = table1_schema2.columns.getByPosition(6);
                        var formattedValue = col.formatvalue(testVal);
                        expect(spy).toHaveBeenCalledWith(testVal, undefined);
                        expect(formattedValue).toEqual(jasmine.any(String));
                        expect(formattedValue).toBe(new Date(testVal).toLocaleString());
                    });
                });
            });
        });
    });
};
{'fraction_non_alphanumeric': 0.112490166943449, 'fraction_numerical': 0.014421816274801155, 'mean_word_length': 1.7412553905126977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '958022', 'n_tokens_mistral': 3171, 'n_tokens_neox': 2929, 'n_words': 505}