<commit_before>component extends="org.lucee.cfml.test.LuceeTestCase"{
    function run( testResults, testBox ) {
        describe("Testcase for LDEV-3522", function() {
            variables.datas = queryNew("id,value","integer,double",[[0,19.22]]);
            it( title="QOQ cast function, cast to INT", body=function( currentSpec ){
                QOQInt = queryExecute( "SELECT CAST(datas.value AS INT) AS valueint FROM datas",  {}, { dbtype="query" } );
                expect( QOQInt.valueint ).toBe( 19 );
            });
            it( title="QOQ cast function, cast to BIT", body=function( currentSpec ){
                QOQBit = queryExecute( "SELECT CAST(datas.id AS BIT) AS valueBit, CAST(datas.value AS BIT) AS valueBit1 FROM datas", {}, { dbtype="query" } );
                expect( QOQBit.valueBit ).toBeTypeOf( "integer" );
                expect( QOQBit.valueBit1 ).toBeTypeOf( "integer" ); 
            });
            it( title="QOQ cast function, cast to DATE", body=function( currentSpec ){
                QOQDate = queryExecute( "SELECT CAST('2222222' AS DATE) AS valueDate FROM datas", {}, { dbtype="query" } );
                expect( isDate(QOQDate.valueDate) ).toBe(true);
            });<commit_msg>Added a tests to QoQ convert()<commit_after>component extends="org.lucee.cfml.test.LuceeTestCase"{
    function run( testResults, testBox ) {
        describe("Testcase for LDEV-3522", function() {
            variables.datas = queryNew("id,value","integer,double",[[0,19.22]]);
            it( title="QOQ cast function, cast to INT", body=function( currentSpec ){
                QOQInt = queryExecute( "SELECT CAST(datas.value AS INT) AS valueint FROM datas",  {}, { dbtype="query" } );
                expect( QOQInt.valueint ).toBe( 19 );
            });
            it( title="QOQ cast function, cast to BIT", body=function( currentSpec ){
                QOQBit = queryExecute( "SELECT CAST(datas.id AS BIT) AS valueBit, CAST(datas.value AS BIT) AS valueBit1 FROM datas", {}, { dbtype="query" } );
                expect( QOQBit.valueBit ).toBeTypeOf( "integer" );
                expect( QOQBit.valueBit1 ).toBeTypeOf( "integer" ); 
            });
            it( title="QOQ cast function, cast to DATE", body=function( currentSpec ){
                QOQDate = queryExecute( "SELECT CAST('2222222' AS DATE) AS valueDate FROM datas", {}, { dbtype="query" } );
                expect( isDate(QOQDate.valueDate) ).toBe(true);
            });
            it( title="QOQ convert function, convert to INT", body=function( currentSpec ){
                QOQConvInt = queryExecute( "SELECT Convert(datas.value, INT) AS valueint FROM datas",  {}, { dbtype="query" } );
                expect( QOQConvInt.valueint ).toBe( 19 );
            });
            it( title="QOQ convert function, convert to BIT", body=function( currentSpec ){
                QOQConvBit = queryExecute( "SELECT CONVERT(datas.id, BIT) AS valueBit, CONVERT(datas.value,  BIT) AS valueBit1 FROM datas", {}, { dbtype="query" } );
                expect( QOQConvBit.valueBit ).toBeTypeOf( "integer" );
                expect( QOQConvBit.valueBit1 ).toBeTypeOf( "integer" ); 
            });
            it( title="QOQ convert function, convert to DATE", body=function( currentSpec ){
                QOQConvDate = queryExecute( "SELECT CONVERT('2017-08-29', DATE) AS valueDate FROM datas", {}, { dbtype="query" } );
                expect(isDate(QOQConvDate.valueDate)).toBe(true);
            });
{'fraction_non_alphanumeric': 0.1396280400572246, 'fraction_numerical': 0.014878397711015737, 'mean_word_length': 2.503006012024048, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '5417573', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1012, 'n_words': 263}