aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2026-01-07 11:50:31 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2026-01-07 11:50:31 +1300
commit2209ab74ab651d958e250d1f991fe9f076f76503 (patch)
treedb13590fdea0c26bc9346ecad186ee065288b4b0 /test
parent8a8435b1f51401ebe4881ab8da1eb4f3913270fd (diff)
Test programs now interleave calculation and text output better
Diffstat (limited to 'test')
-rw-r--r--test/addsubo.adb6
-rw-r--r--test/divo.adb5
-rw-r--r--test/expo.adb6
-rw-r--r--test/logo.adb4
-rw-r--r--test/multo.adb4
5 files changed, 14 insertions, 11 deletions
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