From b9ddfcc0824c0fc6498f1245c092bc634be9c47a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 21 May 2015 12:26:41 -0700 Subject: [PATCH] Spit out JSON when expected =/= actual. --- src/harness/fourslash.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 6867863a941..938e486fee1 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -891,7 +891,7 @@ module FourSlash { } if (ranges.length !== references.length) { - this.raiseError(this.assertionMessage("Rename locations", references.length, ranges.length)); + this.raiseError("Rename location count does not match result.\n\nExpected: " + JSON.stringify(ranges) + "\n\nActual:" + JSON.stringify(references)); } ranges = ranges.sort((r1, r2) => r1.start - r2.start); @@ -904,9 +904,7 @@ module FourSlash { if (reference.textSpan.start !== range.start || ts.textSpanEnd(reference.textSpan) !== range.end) { - this.raiseError(this.assertionMessage("Rename location", - "[" + reference.textSpan.start + "," + ts.textSpanEnd(reference.textSpan) + ")", - "[" + range.start + "," + range.end + ")")); + this.raiseError("Rename location results do not match.\n\nExpected: " + JSON.stringify(ranges) + "\n\nActual:" + JSON.stringify(references)); } } }