title: Short form of if behaves differently
body: <p>In my unit test part, I've a script <code>unit_runner.sh</code> which looks for my unit tests files, sources them and runs every test function in them.</p>
  
  <blockquote>
    <p>unit_test_runner script</p>
  </blockquote>
  
  <p>Please note that my tests are not supposed to write in the <em>stdout</em></p>
  
  <pre><code># ${test} contains the test function name
  # So this runs a test, catch the error message if any
  error_output=$(${test} 2&gt;&amp;1)
  code=$?
  # If the executed test does not return 0 or writes into stderr,
  # consider it as failure
  if [[ ${code} -ne 0 || ! -z ${error_output} ]]
  then
       # error
  fi
  </code></pre>
  
  <blockquote>
    <p>A specific test function
    In one test function I had:</p>
  </blockquote>
  
  <pre><code>test_do_something() {
      # the function I want to test
  
      result=do_something ${input}
  
      if [[ "${result}" = "fake output" ]]
      then
          exit 55
      fi
  }
  </code></pre>
  
  <p>This worked and this test passed. I wanted to shorten it as follows</p>
  
  <pre><code> [[ "${result}" = "fake output" ]] &amp;&amp; exit 55
  </code></pre>
  
  <p>This makes my test fail. AFAIK, these two forms as exactly the same in terms of behaviors.</p>
  
  <p>What's wrong?</p>