Menu

expecting space

Pat Worth
2006-07-05
2013-04-25
  • Pat Worth

    Pat Worth - 2006-07-05

    I have a test case where there is a varchar column that is returned inside a cursor and i am expecting a space. basically, what is happening is that the space is being converted to a NULL by XML parsing, but the returned result set has a space. so, a non-equals assertion is fired because NULL!=space.

    how can i get the result tag to reflect the fact that spaces are relevant?

    thanks.

     
    • Sujit Pal

      Sujit Pal - 2006-07-05

      Not sure, perhaps make it a CDATA? Would that work?

      <result>
      ...<resultset>
      ......<row>
      .........<col><![CDATA[ ]]></col>
      ......</row>
      ...</resultset>
      </result>

      -sujit

       
      • Pat Worth

        Pat Worth - 2006-07-05

        I tried that and got the same result. however, i did not look into it thoroughly. i had more pressing things to follow up on. i may have something stupid going on.

        i will post back when i get a chance to look more closely.

         
    • Pat Worth

      Pat Worth - 2006-07-07

      ok. false alarm - sorry.

      first, yes, CDATA with a space works.

      secondly, i did something stupid. i finished what i was focused on and came back to the beginning. i think i screwed up the copy/paste of the expected results. having a space in the sqlunit test file works too. i must have had things out of order. the result sets i am using are rather larger and very similar and i guess i thought the rows lined up and didn't.

      sorry for wasting bandwidth.

      as an aside, are there any utilities that narrow the scope/more precisely report diffs in result set rows? if not, perhaps that will be my first contribution. i am going to need to do that.

       
      • Sujit Pal

        Sujit Pal - 2006-07-07

        Hi Pat,

        No problem about the false alarm, I am glad it worked both natively and with CDATA, and thanks for getting back with the results.

        As for selective comparison, I think if you do not include the columns you dont want to compare (with the correct row number) in the resultset element, then it will not compare it. Not sure if this is the functionality you are after, but if that is, then its in there already.

        -sujit

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.