Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float-test.red fails if run twice due to system/words/pi being overwritten #5458

Closed
PeterWAWood opened this issue Jan 1, 2024 · 0 comments
Closed
Assignees
Labels
status.built A change in codebase has been done to address the ticket. status.tested The change in code has been manually tested and verified to fix the issue. test.written A regression test has been written and tested for the ticket. type.bug Ticket describes an abnormal behavior, not conforming to the specs or expectation.
Milestone

Comments

@PeterWAWood
Copy link
Contributor

Describe the bug

>> pi
== 3.141592653589793
>> do %float-test.red
~~~started test~~~ float
~~~finished test~~~  float
  Number of Tests Performed:      623
  Number of Assertions Performed: 1793
  Number of Assertions Passed:    1793
  Number of Assertions Failed:    0

== 623
>> do %float-test.red
~~~started test~~~ float
===group=== trigonometric function
--test-- float-cosine-3 FAILED**************
~~~finished test~~~  float
  Number of Tests Performed:      623
  Number of Assertions Performed: 1793
  Number of Assertions Passed:    1792
  Number of Assertions Failed:    1
****************TEST FAILURES****************

== 1246
>> pi
== 3.14159265358979
>> 0.0 = cosine/radians pi / 2
== false
>> pi: 3.141592653589793
== 3.141592653589793
>> 0.0 = cosine/radians pi / 2
== true

The issue appears to be caused by tests in the Float-Locals group which overwrite pi.

To reproduce
Run float-test.red twice in the same console session

Expected behavior
The tests should not overwrite the "builtin" pi.

Platform version

-----------RED & PLATFORM VERSION-----------
RED: [ branch: "master" tag: #v0.6.4 ahead: 5075 date: 22-Dec-2023/9:07:34 commit: #6cb7d502bcbfae8b00630adee6561909eee2b478 ]
PLATFORM: [ name: "Raspbian GNU/Linux 11 (bullseye)" OS: 'Linux arch: 'aarch64 version: 6.1.21 build: "#1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023" ]
--------------------------------------------
@dockimbel dockimbel self-assigned this Jan 9, 2024
dockimbel added a commit that referenced this issue Jan 9, 2024
@dockimbel dockimbel added status.built A change in codebase has been done to address the ticket. status.tested The change in code has been manually tested and verified to fix the issue. type.bug Ticket describes an abnormal behavior, not conforming to the specs or expectation. test.written A regression test has been written and tested for the ticket. labels Jan 9, 2024
@dockimbel dockimbel added this to the 0.7.0 milestone Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status.built A change in codebase has been done to address the ticket. status.tested The change in code has been manually tested and verified to fix the issue. test.written A regression test has been written and tested for the ticket. type.bug Ticket describes an abnormal behavior, not conforming to the specs or expectation.
Projects
None yet
Development

No branches or pull requests

2 participants