From 2209ab74ab651d958e250d1f991fe9f076f76503 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 7 Jan 2026 11:50:31 +1300 Subject: Test programs now interleave calculation and text output better --- test/addsubo.adb | 6 ++++-- test/divo.adb | 5 ++--- test/expo.adb | 6 ++++-- test/logo.adb | 4 ++-- test/multo.adb | 4 ++-- 5 files changed, 14 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/addsubo.adb b/test/addsubo.adb index 1033ea1..3ddf06c 100644 --- a/test/addsubo.adb +++ b/test/addsubo.adb @@ -55,8 +55,9 @@ procedure Addsubo is Result : State; begin Math.Add (Relation, B (Addend1) & B (Addend2) & Sum); + TIO.Put (P (Addend1) & " + " & P (Addend2) & " = "); Result := Relation.Run; - TIO.Put_Line (P (Addend1) & " + " & P (Addend2) & " = " & PV (Sum.Resolve (Result))); + TIO.Put_Line (PV (Sum.Resolve (Result))); end Add_Test; procedure Sub_Test @@ -67,8 +68,9 @@ procedure Addsubo is Result : State; begin Math.Subtract (Relation, B (Minuend) & B (Subtrahend) & Diff); + TIO.Put (P (Minuend) & " - " & P (Subtrahend) & " = "); Result := Relation.Run; - TIO.Put_Line (P (Minuend) & " - " & P (Subtrahend) & " = " & PV (Diff.Resolve (Result))); + TIO.Put_Line (PV (Diff.Resolve (Result))); end Sub_Test; begin diff --git a/test/divo.adb b/test/divo.adb index eabc32c..8c39e79 100644 --- a/test/divo.adb +++ b/test/divo.adb @@ -56,10 +56,9 @@ procedure Divo is Result : State; begin Math.Divide (Relation, B (Dividend) & B (Divisor) & Quotient & Remainder); + TIO.Put (P (Dividend) & " / " & P (Divisor) & " = "); Result := Relation.Run; - TIO.Put_Line (P (Dividend) & " / " & P (Divisor) & - " = " & PV (Quotient.Resolve (Result)) & - " r " & PV (Remainder.Resolve (Result))); + TIO.Put_Line (PV (Quotient.Resolve (Result)) & " r " & PV (Remainder.Resolve (Result))); end Test; begin diff --git a/test/expo.adb b/test/expo.adb index ea2e950..dbfa903 100644 --- a/test/expo.adb +++ b/test/expo.adb @@ -55,8 +55,9 @@ procedure Expo is Result : State; begin Math.Exponential (Relation, B (Base) & B (Exponent) & Power); + TIO.Put (P (Base) & "^" & P (Exponent) & " = "); Result := Relation.Run; - TIO.Put_Line (P (Base) & "^" & P (Exponent) & " = " & PV (Power.Resolve (Result))); + TIO.Put_Line (PV (Power.Resolve (Result))); end Exp_Test; procedure Repeated_Mult_Test @@ -67,8 +68,9 @@ procedure Expo is Result : State; begin Math.Repeated_Multiply (Relation, B (Base) & B (Exponent) & Power); + TIO.Put (P (Base) & "^" & P (Exponent) & " = "); Result := Relation.Run; - TIO.Put_Line (P (Base) & "^" & P (Exponent) & " = " & PV (Power.Resolve (Result))); + TIO.Put_Line (PV (Power.Resolve (Result))); end Repeated_Mult_Test; begin diff --git a/test/logo.adb b/test/logo.adb index 3c2412f..575bdad 100644 --- a/test/logo.adb +++ b/test/logo.adb @@ -56,9 +56,9 @@ procedure Logo is Result : State; begin Math.Logarithm (Relation, B (Power) & B (Base) & Exponent & Remainder); + TIO.Put ("log_" & P (Base) & " (" & P (Power) & ") = "); Result := Relation.Run; - TIO.Put_Line ("log_" & P (Base) & " (" & P (Power) & ") = " & - PV (Exponent.Resolve (Result)) & " r " & PV (Remainder.Resolve (Result))); + TIO.Put_Line (PV (Exponent.Resolve (Result)) & " r " & PV (Remainder.Resolve (Result))); end Test; begin diff --git a/test/multo.adb b/test/multo.adb index ad49453..f22d570 100644 --- a/test/multo.adb +++ b/test/multo.adb @@ -55,9 +55,9 @@ procedure Multo is Result : State; begin Math.Multiply (Relation, B (Multiplier) & B (Multiplicand) & Product); + TIO.Put (P (Multiplier) & " * " & P (Multiplicand) & " = "); Result := Relation.Run; - TIO.Put_Line (P (Multiplier) & " * " & P (Multiplicand) & - " = " & PV (Product.Resolve (Result))); + TIO.Put_Line (PV (Product.Resolve (Result))); end Test; begin -- cgit