Changeset: 7fee89caba1f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7fee89caba1f
Modified Files:
sql/test/pg_regress/Tests/float4.test
sql/test/pg_regress/Tests/float8.test
testing/sqllogictest.py
Branch: default
Log Message:
don't distinguish '-0.000' from '0.000', and approved test output accordingly
diffs (280 lines):
diff --git a/sql/test/pg_regress/Tests/float4.test
b/sql/test/pg_regress/Tests/float4.test
--- a/sql/test/pg_regress/Tests/float4.test
+++ b/sql/test/pg_regress/Tests/float4.test
@@ -86,9 +86,9 @@ query TR rowsort
SELECT '' AS five, FLOAT4_TBL.* FROM FLOAT4_TBL
----
(empty)
--0.000
+-34.840
(empty)
--34.840
+0.000
(empty)
0.000
(empty)
@@ -104,9 +104,9 @@ query TR rowsort
SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3'
----
(empty)
--0.000
+-34.840
(empty)
--34.840
+0.000
(empty)
0.000
(empty)
@@ -126,9 +126,9 @@ query TR rowsort
SELECT '' AS three, f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1
----
(empty)
--0.000
+-34.840
(empty)
--34.840
+0.000
(empty)
0.000
(empty)
@@ -140,9 +140,9 @@ query TR rowsort
SELECT '' AS three, f.* FROM FLOAT4_TBL f WHERE f.f1 < '1004.3'
----
(empty)
--0.000
+-34.840
(empty)
--34.840
+0.000
(empty)
0.000
(empty)
@@ -154,9 +154,9 @@ query TR rowsort
SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1
----
(empty)
--0.000
+-34.840
(empty)
--34.840
+0.000
(empty)
0.000
(empty)
@@ -170,9 +170,9 @@ query TR rowsort
SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE f.f1 <= '1004.3'
----
(empty)
--0.000
+-34.840
(empty)
--34.840
+0.000
(empty)
0.000
(empty)
@@ -188,10 +188,10 @@ SELECT '' AS three, f.f1, f.f1 * '-10' A
----
(empty)
0.000
--0.000
+0.000
(empty)
0.000
--0.000
+0.000
(empty)
1004.300
-10043.000
@@ -222,10 +222,10 @@ SELECT '' AS three, f.f1, f.f1 / '-10' A
----
(empty)
0.000
--0.000
+0.000
(empty)
0.000
--0.000
+0.000
(empty)
1004.300
-100.430
@@ -258,9 +258,6 @@ SELECT '' AS five, f.f1, abs(f1) AS abs_
FROM FLOAT4_TBL f
----
(empty)
--0.000
-0.000
-(empty)
-34.840
34.840
(empty)
@@ -273,6 +270,9 @@ SELECT '' AS five, f.f1, abs(f1) AS abs_
0.000
0.000
(empty)
+0.000
+0.000
+(empty)
1004.300
1004.300
(empty)
@@ -288,9 +288,6 @@ SELECT '' AS five, f.f1, round(f.f1, 0)
FROM FLOAT4_TBL f
----
(empty)
--0.000
--0.000
-(empty)
-34.840
-35.000
(empty)
@@ -303,6 +300,9 @@ SELECT '' AS five, f.f1, round(f.f1, 0)
0.000
0.000
(empty)
+0.000
+0.000
+(empty)
1004.300
1004.000
(empty)
@@ -312,9 +312,9 @@ SELECT '' AS five, f.f1, round(f.f1, 0)
query R rowsort
select ceil(f1) as ceil_f1 from float4_tbl f
----
--0.000
-34.000
0.000
+0.000
1.000
1.000
1005.000
@@ -323,9 +323,9 @@ select ceil(f1) as ceil_f1 from float4_t
query R rowsort
select ceiling(f1) as ceiling_f1 from float4_tbl f
----
--0.000
-34.000
0.000
+0.000
1.000
1.000
1005.000
@@ -403,9 +403,9 @@ query TR rowsort
SELECT '' AS five, * FROM FLOAT4_TBL
----
(empty)
--0.000
+-34.840
(empty)
--34.840
+0.000
(empty)
0.000
(empty)
@@ -429,12 +429,6 @@ query TR rowsort
SELECT '' AS five, * FROM FLOAT4_TBL
----
(empty)
--0.000
-(empty)
--0.000
-(empty)
--0.000
-(empty)
-1004.300
(empty)
-123456790000000008192.000
@@ -442,6 +436,12 @@ SELECT '' AS five, * FROM FLOAT4_TBL
-34.840
(empty)
0.000
+(empty)
+0.000
+(empty)
+0.000
+(empty)
+0.000
statement ok
DROP TABLE FLOAT4_TBL
diff --git a/sql/test/pg_regress/Tests/float8.test
b/sql/test/pg_regress/Tests/float8.test
--- a/sql/test/pg_regress/Tests/float8.test
+++ b/sql/test/pg_regress/Tests/float8.test
@@ -30,7 +30,7 @@ SELECT cast('10e-400' as double)
query R rowsort
SELECT cast('-10e-400' as double)
----
--0.000
+0.000
statement error
INSERT INTO FLOAT8_TBL(f1) VALUES (' ')
@@ -169,7 +169,7 @@ SELECT '' AS three, f.f1, f.f1 * '-10' A
----
(empty)
0.000
--0.000
+0.000
(empty)
1004.300
-10043.000
@@ -199,7 +199,7 @@ SELECT '' AS three, f.f1, f.f1 / '-10' A
----
(empty)
0.000
--0.000
+0.000
(empty)
1004.300
-100.430
@@ -410,8 +410,6 @@ query TR rowsort
SELECT '' AS five, * FROM FLOAT8_TBL
----
(empty)
--0.000
-(empty)
-1004.300
(empty)
-123456789012339998178055383778200200677029538578556143779522728938091625064448320947338361845446375953513236661280206676435709550555887864880290298685218909703795934625015156010452441377150897232019456.000
@@ -419,6 +417,8 @@ SELECT '' AS five, * FROM FLOAT8_TBL
-34.840
(empty)
0.000
+(empty)
+0.000
statement error
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400')
@@ -454,8 +454,6 @@ query TR rowsort
SELECT '' AS five, * FROM FLOAT8_TBL
----
(empty)
--0.000
-(empty)
-1004.300
(empty)
-123456789012339998178055383778200200677029538578556143779522728938091625064448320947338361845446375953513236661280206676435709550555887864880290298685218909703795934625015156010452441377150897232019456.000
@@ -463,6 +461,8 @@ SELECT '' AS five, * FROM FLOAT8_TBL
-34.840
(empty)
0.000
+(empty)
+0.000
statement ok
DROP TABLE FLOAT8_TBL
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -495,7 +495,8 @@ class SQLLogic:
elif columns[i] == 'D':
nrow.append(str(row[i]))
elif columns[i] == 'R':
- nrow.append(f'{row[i]:.3f}')
+ val = f'{row[i]:.3f}'
+ nrow.append('0.000' if val == '-0.000' else val)
else:
self.raise_error('incorrect column type indicator')
except TypeError:
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]