Skip to content

Commit

Permalink
better message for assert.
Browse files Browse the repository at this point in the history
  • Loading branch information
petermaxlee committed Aug 10, 2016
1 parent 14f4959 commit 288b699
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ class SQLQueryTestSuite extends QueryTest with SharedSQLContext {
val expectedOutputs: Seq[QueryOutput] = {
val goldenOutput = fileToString(new File(testCase.resultFile))
val segments = goldenOutput.split("-- !query.+\n")
assert(segments.size == outputs.size * 3 + 1) // each query has 3 segments, plus the header

// each query has 3 segments, plus the header
assert(segments.size == outputs.size * 3 + 1,
s"Expected ${outputs.size * 3 + 1} blocks in result file but got ${segments.size}. " +
s"Try regenerate the result files.")
Seq.tabulate(outputs.size) { i =>
QueryOutput(
sql = segments(i * 3 + 1).trim,
Expand Down

0 comments on commit 288b699

Please sign in to comment.