reader/spirv: Fix ExpectEq() tests

Don't end the EXPECT_THAT() with `<< ToString(p->builder(), fe.ast_body());`
This string is already emitted in the error, and calling ast_body() a second time triggers an assert as the builder is already finalized.

Change-Id: Ied6aca73937e86aa6ce2d8cff8a09f67b5082349
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47767
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/reader/spirv/function_arithmetic_test.cc b/src/reader/spirv/function_arithmetic_test.cc
index d9d9b5a..5d0fdfc 100644
--- a/src/reader/spirv/function_arithmetic_test.cc
+++ b/src/reader/spirv/function_arithmetic_test.cc
@@ -155,8 +155,7 @@
         ScalarConstructor[not set]{30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, SNegate_Int_Uint) {
@@ -184,8 +183,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, SNegate_Uint_Int) {
@@ -213,8 +211,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, SNegate_Uint_Uint) {
@@ -244,8 +241,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, SNegate_SignedVec_SignedVec) {
@@ -275,8 +271,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, SNegate_SignedVec_UnsignedVec) {
@@ -308,8 +303,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_SignedVec) {
@@ -341,8 +335,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_UnsignedVec) {
@@ -376,8 +369,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, FNegate_Scalar) {
@@ -403,8 +395,7 @@
         ScalarConstructor[not set]{50.000000}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryArithTest, FNegate_Vector) {
@@ -434,8 +425,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 struct BinaryData {
@@ -1055,8 +1045,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 INSTANTIATE_TEST_SUITE_P(
@@ -1201,8 +1190,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 INSTANTIATE_TEST_SUITE_P(
@@ -1243,8 +1231,7 @@
         Identifier[not set]{x_2}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvBinaryArithTestBasic, MatrixTimesScalar) {
@@ -1272,8 +1259,7 @@
         Identifier[not set]{x_2}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvBinaryArithTestBasic, VectorTimesMatrix) {
@@ -1301,8 +1287,7 @@
         Identifier[not set]{x_2}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvBinaryArithTestBasic, MatrixTimesVector) {
@@ -1330,8 +1315,7 @@
         Identifier[not set]{x_2}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvBinaryArithTestBasic, MatrixTimesMatrix) {
@@ -1359,8 +1343,7 @@
         Identifier[not set]{x_2}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvBinaryArithTestBasic, Dot) {
@@ -1390,8 +1373,7 @@
         )
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvBinaryArithTestBasic, OuterProduct) {
diff --git a/src/reader/spirv/function_bit_test.cc b/src/reader/spirv/function_bit_test.cc
index e478f3d..2c6e266 100644
--- a/src/reader/spirv/function_bit_test.cc
+++ b/src/reader/spirv/function_bit_test.cc
@@ -705,8 +705,7 @@
         ScalarConstructor[not set]{30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryBitTest, Not_Int_Uint) {
@@ -734,8 +733,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryBitTest, Not_Uint_Int) {
@@ -763,8 +761,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryBitTest, Not_Uint_Uint) {
@@ -790,8 +787,7 @@
         ScalarConstructor[not set]{10}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryBitTest, Not_SignedVec_SignedVec) {
@@ -821,8 +817,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryBitTest, Not_SignedVec_UnsignedVec) {
@@ -854,8 +849,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryBitTest, Not_UnsignedVec_SignedVec) {
@@ -887,8 +881,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 TEST_F(SpvUnaryBitTest, Not_UnsignedVec_UnsignedVec) {
   const auto assembly = CommonTypes() + R"(
@@ -917,8 +910,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 std::string BitTestPreamble() {
diff --git a/src/reader/spirv/function_call_test.cc b/src/reader/spirv/function_call_test.cc
index b27d2e7..c35e55f 100644
--- a/src/reader/spirv/function_call_test.cc
+++ b/src/reader/spirv/function_call_test.cc
@@ -102,8 +102,7 @@
     }
   }
 }
-Return{})"))
-        << ToString(p->builder(), fe.ast_body());
+Return{})"));
   }
 
   {
@@ -113,7 +112,7 @@
   {
     ScalarConstructor[not set]{42}
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
   }
 }
 
@@ -174,8 +173,7 @@
   Identifier[not set]{x_10}
   Identifier[not set]{x_1}
 }
-Return{})"))
-        << ToString(p->builder(), fe.ast_body());
+Return{})"));
   }
   {
     FunctionEmitter fe(p.get(), *spirv_function(p.get(), 50));
@@ -184,7 +182,7 @@
   {
     ScalarConstructor[not set]{42}
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
   }
 }
 
diff --git a/src/reader/spirv/function_composite_test.cc b/src/reader/spirv/function_composite_test.cc
index 1478c5e..fd06d3b 100644
--- a/src/reader/spirv/function_composite_test.cc
+++ b/src/reader/spirv/function_composite_test.cc
@@ -129,7 +129,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTest_Composite_Construct, Matrix) {
@@ -169,8 +169,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_Composite_Construct, Array) {
@@ -200,8 +199,7 @@
         ScalarConstructor[not set]{5}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_Composite_Construct, Struct) {
@@ -233,8 +231,7 @@
         ScalarConstructor[not set]{30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 using SpvParserTest_CompositeExtract = SpvParserTest;
@@ -266,8 +263,7 @@
         Identifier[not set]{y}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_CompositeExtract, Vector_IndexTooBigError) {
@@ -313,8 +309,7 @@
         ScalarConstructor[not set]{2}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_CompositeExtract, Matrix_IndexTooBigError) {
@@ -367,8 +362,7 @@
         Identifier[not set]{y}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_CompositeExtract, Array) {
@@ -398,8 +392,7 @@
         ScalarConstructor[not set]{3}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_CompositeExtract, RuntimeArray_IsError) {
@@ -450,8 +443,7 @@
         Identifier[not set]{field2}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_CompositeExtract, Struct_DifferOnlyInMemberName) {
@@ -568,8 +560,7 @@
         Identifier[not set]{y}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 using SpvParserTest_CompositeInsert = SpvParserTest;
@@ -1066,7 +1057,7 @@
       Identifier[not set]{x_1}
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTest_CopyObject, Pointer) {
@@ -1105,7 +1096,7 @@
       Identifier[not set]{x_1}
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 using SpvParserTest_VectorShuffle = SpvParserTest;
@@ -1152,7 +1143,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_UseBoth) {
@@ -1209,8 +1200,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_AllOnesMapToNull) {
@@ -1241,8 +1231,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvParserTest_VectorShuffle, IndexTooBig_IsError) {
diff --git a/src/reader/spirv/function_conversion_test.cc b/src/reader/spirv/function_conversion_test.cc
index fb65000..fa3f328 100644
--- a/src/reader/spirv/function_conversion_test.cc
+++ b/src/reader/spirv/function_conversion_test.cc
@@ -88,8 +88,7 @@
         ScalarConstructor[not set]{50.000000}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, Bitcast_Vector) {
@@ -118,8 +117,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertSToF_BadArg) {
@@ -244,8 +242,7 @@
         Identifier[not set]{x_30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertSToF_Scalar_FromUnsigned) {
@@ -273,8 +270,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromSigned) {
@@ -300,8 +296,7 @@
         Identifier[not set]{x_30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromUnsigned) {
@@ -329,8 +324,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_BadArgType) {
@@ -391,8 +385,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_FromUnsigned) {
@@ -418,8 +411,7 @@
         Identifier[not set]{x_30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromSigned) {
@@ -447,8 +439,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromUnsigned) {
@@ -474,8 +465,7 @@
         Identifier[not set]{x_30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_BadArgType) {
@@ -535,8 +525,7 @@
         Identifier[not set]{x_30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_ToUnsigned) {
@@ -564,8 +553,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToSigned) {
@@ -591,8 +579,7 @@
         Identifier[not set]{x_30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToUnsigned) {
@@ -620,8 +607,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertFToU_Scalar_BadArgType) {
@@ -683,8 +669,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertFToU_Scalar_ToUnsigned) {
@@ -710,8 +695,7 @@
         Identifier[not set]{x_30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertFToU_Vector_ToSigned) {
@@ -739,8 +723,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryConversionTest, ConvertFToU_Vector_ToUnsigned) {
@@ -766,8 +749,7 @@
         Identifier[not set]{x_30}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 // TODO(dneto): OpSConvert // only if multiple widths
diff --git a/src/reader/spirv/function_logical_test.cc b/src/reader/spirv/function_logical_test.cc
index a8e23c5..061d83a 100644
--- a/src/reader/spirv/function_logical_test.cc
+++ b/src/reader/spirv/function_logical_test.cc
@@ -213,8 +213,7 @@
         ScalarConstructor[not set]{true}
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvUnaryLogicalTest, LogicalNot_Vector) {
@@ -244,8 +243,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 struct BinaryData {
@@ -737,8 +735,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordEqual_Vector) {
@@ -776,8 +773,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) {
@@ -807,8 +803,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordNotEqual_Vector) {
@@ -846,8 +841,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) {
@@ -877,8 +871,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordLessThan_Vector) {
@@ -916,8 +909,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) {
@@ -947,8 +939,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordLessThanEqual_Vector) {
@@ -986,8 +977,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) {
@@ -1017,8 +1007,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordGreaterThan_Vector) {
@@ -1056,8 +1045,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) {
@@ -1087,8 +1075,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Vector) {
@@ -1126,8 +1113,7 @@
         }
       }
     }
-  })"))
-      << ToString(p->builder(), fe.ast_body());
+  })"));
 }
 
 TEST_F(SpvFUnordTest, Select_BoolCond_BoolParams) {
@@ -1159,7 +1145,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvFUnordTest, Select_BoolCond_IntScalarParams) {
@@ -1191,7 +1177,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvFUnordTest, Select_BoolCond_FloatScalarParams) {
@@ -1223,7 +1209,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvFUnordTest, Select_BoolCond_VectorParams) {
@@ -1263,7 +1249,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvFUnordTest, Select_VecBoolCond_VectorParams) {
@@ -1307,7 +1293,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 using SpvLogicalTest = SpvParserTestBase<::testing::Test>;
@@ -1343,7 +1329,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvLogicalTest, All) {
@@ -1377,7 +1363,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvLogicalTest, IsNan_Scalar) {
@@ -1407,7 +1393,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvLogicalTest, IsNan_Vector) {
@@ -1441,7 +1427,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvLogicalTest, IsInf_Scalar) {
@@ -1471,7 +1457,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvLogicalTest, IsInf_Vector) {
@@ -1505,7 +1491,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 // TODO(dneto): Kernel-guarded instructions.
diff --git a/src/reader/spirv/function_memory_test.cc b/src/reader/spirv/function_memory_test.cc
index 5d3b255..d0cb02b 100644
--- a/src/reader/spirv/function_memory_test.cc
+++ b/src/reader/spirv/function_memory_test.cc
@@ -345,7 +345,7 @@
     Identifier[not set]{z}
   }
   ScalarConstructor[not set]{42}
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTest, EmitStatement_AccessChain_VectorConstOutOfBounds) {
@@ -585,7 +585,7 @@
     Identifier[not set]{ancientness}
   }
   ScalarConstructor[not set]{420.000000}
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTest, EmitStatement_AccessChain_StructNonConstIndex) {
@@ -921,8 +921,7 @@
     ScalarConstructor[not set]{1}
   }
   ScalarConstructor[not set]{0}
-})")) << ToString(p->builder(), fe.ast_body())
-      << p->error();
+})")) << p->error();
 }
 
 TEST_F(SpvParserTest, RemapStorageBuffer_ThroughCopyObject_WithoutHoisting) {
@@ -965,8 +964,7 @@
 Assignment{
   Identifier[not set]{x_2}
   ScalarConstructor[not set]{0}
-})")) << ToString(p->builder(), fe.ast_body())
-      << p->error();
+})")) << p->error();
 }
 
 TEST_F(SpvParserTest, RemapStorageBuffer_ThroughCopyObject_WithHoisting) {
@@ -1036,8 +1034,7 @@
   ScalarConstructor[not set]{0}
 }
 Return{}
-)")) << ToString(p->builder(), fe.ast_body())
-     << p->error();
+)")) << p->error();
 }
 
 TEST_F(SpvParserTest, DISABLED_RemapStorageBuffer_ThroughFunctionCall) {
diff --git a/src/reader/spirv/function_misc_test.cc b/src/reader/spirv/function_misc_test.cc
index efc249a..c2a5e62 100644
--- a/src/reader/spirv/function_misc_test.cc
+++ b/src/reader/spirv/function_misc_test.cc
@@ -104,7 +104,7 @@
       ScalarConstructor[not set]{0.000000}
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTestMiscInstruction, OpUndef_BeforeFunction_Vector) {
@@ -184,7 +184,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Scalar) {
@@ -247,7 +247,7 @@
       ScalarConstructor[not set]{0.000000}
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Vector) {
@@ -310,7 +310,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Matrix) {
@@ -351,7 +351,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Array) {
@@ -385,7 +385,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Struct) {
@@ -420,7 +420,7 @@
       }
     }
   }
-})")) << ToString(p->builder(), fe.ast_body());
+})"));
 }
 
 TEST_F(SpvParserTestMiscInstruction, OpNop) {
@@ -437,7 +437,7 @@
   FunctionEmitter fe(p.get(), *spirv_function(p.get(), 100));
   EXPECT_TRUE(fe.EmitBody()) << p->error();
   EXPECT_THAT(ToString(p->builder(), fe.ast_body()), Eq(R"(Return{}
-)")) << ToString(p->builder(), fe.ast_body());
+)"));
 }
 
 // Test swizzle generation.
diff --git a/src/reader/spirv/function_var_test.cc b/src/reader/spirv/function_var_test.cc
index cb70b42..53a028b 100644
--- a/src/reader/spirv/function_var_test.cc
+++ b/src/reader/spirv/function_var_test.cc
@@ -356,7 +356,7 @@
     }
   }
 }
-)")) << ToString(p->builder(), fe.ast_body());
+)"));
 }
 
 TEST_F(SpvParserTest, EmitFunctionVariables_MatrixInitializer) {
@@ -442,7 +442,7 @@
     }
   }
 }
-)")) << ToString(p->builder(), fe.ast_body());
+)"));
 }
 
 TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer_Alias) {
@@ -512,7 +512,7 @@
     }
   }
 }
-)")) << ToString(p->builder(), fe.ast_body());
+)"));
 }
 
 TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer_Alias_Null) {
@@ -547,7 +547,7 @@
     }
   }
 }
-)")) << ToString(p->builder(), fe.ast_body());
+)"));
 }
 
 TEST_F(SpvParserTest, EmitFunctionVariables_StructInitializer) {
@@ -587,7 +587,7 @@
     }
   }
 }
-)")) << ToString(p->builder(), fe.ast_body());
+)"));
 }
 
 TEST_F(SpvParserTest, EmitFunctionVariables_StructInitializer_Null) {
@@ -627,7 +627,7 @@
     }
   }
 }
-)")) << ToString(p->builder(), fe.ast_body());
+)"));
 }
 
 TEST_F(SpvParserTest,