Skip to content

Commit

Permalink
TESTS: Back out additional float tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterWAWood committed Feb 29, 2012
1 parent a2c30a5 commit c7ad3ac
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 111 deletions.
11 changes: 0 additions & 11 deletions red-system/tests/source/compiler/print-test.r
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,5 @@ change-dir %../ ;; revert to tests/ directory from runnable/
}
--assert-printed? "20001"

--test-- "p2"
--compile-and-run-this {
print [1.0 lf]
}
--assert-printed? "1.0"

--test-- "p3"
--compile-and-run-this {
print [as-float32 1.0 lf]
}
--assert-printed? "1.0"

~~~end-file~~~
39 changes: 0 additions & 39 deletions red-system/tests/source/units/float-test.reds
Original file line number Diff line number Diff line change
Expand Up @@ -237,44 +237,5 @@ Red/System [

===end-group===

===start-group=== "float arguments to typed functions"
fatf1: function [
[typed]
count [integer!]
list [typed-value!]
return: [float!]
/local
a [float!]
][
a: as float! list/value
]

fatf2: function [
[typed]
count [integer!]
list [typed-value!]
return: [float!]
/local
a [float!]
b [float!]
][
a: as float! list/value
list: list + 1
b: as float! list/value
a + b
]

--test-- "fatf-1"
--assert 2.0 = fatf1 2.0

--test-- "fatf-2"
--assert 2.0 = fatf1 1.0 + fatf1 1.0

--test-- "fatf-3"
--assert 3.0 = fatf2 1.0 2.0


===end-group===


~~~end-file~~~
61 changes: 0 additions & 61 deletions red-system/tests/source/units/float32-test.reds
Original file line number Diff line number Diff line change
Expand Up @@ -226,66 +226,5 @@ Red/System [

===end-group===

===start-group=== "float32 arguments to typed functions"
fatf1: function [
[typed]
count [integer!]
list [typed-value!]
return: [float32!]
/local
a [float32!]
][
a: as float32! list/value
]

fatf2: function [
[typed]
count [integer!]
list [typed-value!]
return: [float32!]
/local
a [float32!]
b [float32!]
][
a: as float32! list/value
list: list + 1
b: as float32! list/value
a + b
]

--test-- "fatf-1"
--assert (as float32! 2.0) = (fatf1 as float32! 2.0)

--test-- "fatf-2"
--assert (as float32! 2.0) = ((fatf1 as float32! 1.0) + (fatf1 as float32! 1.0))

--test-- "fatf-3"
--assert (as float32! 3.0) = fatf2 as float32! 1.0 as float! 2.0


===end-group===

===start-group=== "Casting float! arguments to float32!"

cfaf1: function [
a [float!]
return: [float32!]
][
as float32! a
]
cfaf2: function [
a [float!]
b [float!]
return: [float32!]
][
(as float32! a) + (as float32! b)
]

--test-- "cfaf1"
--assert (as float32! 1.0) = cfaf1 1.0

--test-- "cfaf2"
--assertf32~= (as float32! 3.0) (cfaf2 1.0 2.0) (as float32! 0.1e-7)


~~~end-file~~~

0 comments on commit c7ad3ac

Please sign in to comment.