From ef4f6cfae48324e6512e8279ce966d685e48b575 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 20 Mar 2020 20:15:12 -0400 Subject: [PATCH] Use '@' to separate form@line references. --- src/core/Line.ts | 4 ++-- src/core/Trace.test.ts | 14 +++++++------- src/core/Trace.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/Line.ts b/src/core/Line.ts index 3a838a0..300192c 100644 --- a/src/core/Line.ts +++ b/src/core/Line.ts @@ -58,7 +58,7 @@ export class ReferenceLine, // the one the Line is in, erase |form|'s type with |as any| to // keep TypeScript happy. constructor(form: FormClass, line: L, description?: string, fallback?: T) { - super(description || `Reference ${form.name}-${line}`); + super(description || `Reference ${form.name}@${line}`); this._form = form; this._line = line; this._fallback = fallback; @@ -108,7 +108,7 @@ export class AccumulatorLine, private _line: L; constructor(form: FormClass, line: L, description?: string) { - super(description || `Accumulator ${form.name}-${line}`); + super(description || `Accumulator ${form.name}@${line}`); this._form = form; this._line = line; } diff --git a/src/core/Trace.test.ts b/src/core/Trace.test.ts index 42689d8..3f49fde 100644 --- a/src/core/Trace.test.ts +++ b/src/core/Trace.test.ts @@ -46,21 +46,21 @@ describe('tracing', () => { test('input line', () => { f.getValue(tr, 'i1'); const trace = getLastTraceList(); - expect(trace).toStrictEqual([ [ 'TF-i1 (Input from name)', 'TF input: name' ] ]); + expect(trace).toStrictEqual([ [ 'TF@i1 (Input from name)', 'TF input: name' ] ]); }); test('computed line via input', () => { f.getValue(tr, 'c1'); const trace = getLastTraceList(); - expect(trace).toStrictEqual([ [ 'TF-c1', 'TF input: name' ] ]); + expect(trace).toStrictEqual([ [ 'TF@c1', 'TF input: name' ] ]); }); test('computed line via input line', () => { f.getValue(tr, 'c2'); const trace = getLastTraceList(); expect(trace).toStrictEqual([ - [ 'TF-c2', 'TF-i2 (Input from value)' ], - [ 'TF-i2 (Input from value)', 'TF input: value' ] + [ 'TF@c2', 'TF@i2 (Input from value)' ], + [ 'TF@i2 (Input from value)', 'TF input: value' ] ]); }); @@ -68,9 +68,9 @@ describe('tracing', () => { f.getValue(tr, 'r2'); const trace = getLastTraceList(); expect(trace).toStrictEqual([ - [ 'TF-r2 (Reference TestForm-c2)', 'TF-c2' ], - [ 'TF-c2', 'TF-i2 (Input from value)' ], - [ 'TF-i2 (Input from value)', 'TF input: value' ] + [ 'TF@r2 (Reference TestForm@c2)', 'TF@c2' ], + [ 'TF@c2', 'TF@i2 (Input from value)' ], + [ 'TF@i2 (Input from value)', 'TF input: value' ] ]); }); }); diff --git a/src/core/Trace.ts b/src/core/Trace.ts index 512e2e7..997aefc 100644 --- a/src/core/Trace.ts +++ b/src/core/Trace.ts @@ -63,5 +63,5 @@ function formatLine(line: Line): string { const description = line.description ? ` (${line.description})` : ''; if (line.form === undefined) return `${line.constructor.name}${description}`; - return `${line.form.name}-${line.id}${description}`; + return `${line.form.name}@${line.id}${description}`; } -- 2.43.5