Uploaded image for project: 'Bigtop'
  1. Bigtop
  2. BIGTOP-2233

Fix BIGTOP-2009

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      While working on BIGTOP-2232, I have came across BIGTOP-2009 fix. Well, despite wrong formatting (which needs to be fixed separately) I have found a couple of truly amazing code examples. Here it is:

      • the patch introduces a function to look through a collection of Strings and find a partial match. Naturally, the function return type is boolean
      • the best part is how this function is used in assertTrue calls. Hold on....
                        scripts.lookForGivenString(sh.getOut(),
                                                  ".test_4.txt.crc") == true);
        

        In other words, let's assert the functionWithBooleanReturnType() == true. Guess what? The function already returns boolean. You don't need to compare it to a logic constant.

      well, besides, instead of inventing a square wheel, let's just use grep. After all, these new tests are supposedly written in Groovy.

      Attachments

        1. 0001-BIGTOP-2233.-Fix-BIGTOP-2009.patch
          18 kB
          Konstantin I Boudnik
        2. 0001-BIGTOP-2233.-Fix-BIGTOP-2009.patch
          18 kB
          Konstantin I Boudnik
        3. 0001-BIGTOP-2233.-Fix-BIGTOP-2009.patch
          18 kB
          Konstantin I Boudnik

        Issue Links

          Activity

            People

              cos Konstantin I Boudnik
              cos Konstantin I Boudnik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: