SimpleTest:assertWithinMargin() and assertOutsideMargin()
ztyx - November 16, 2008 - 11:08
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | simpletest.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | boombatower |
| Status: | needs work |
| Issue tags: | Needs tests |
Description
The original SimpleTest package contains the functions assertWithinMargin() and assertOutsideMargin(). Both of these are very handy when you are working with floating point numbers that cannot be compared for equality (because of numerical errors).
I am attaching a patch that adds these two functions to the DrupalTestCase.
Also, can these be easily merged into Drupal 7?
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| drupal_web_test_case.margin-tests.patch | 2.68 KB | Idle | Failed: Failed to apply patch. | View details | Re-test |

#1
Oh, I meant
DrupalWebTestCaseof course...#2
This should be done in D7 and then backported.
#3
The last submitted patch failed testing.
#4
See: #335122: Test clean HEAD after every commit and http://pastebin.ca/1258476
#5
The last submitted patch failed testing.
#6
Reroll from root directory.
#7
Are there existing use cases for these in core? Would be nice to use them if possible.
#8
I think we should have some basic tests for these in simpletest.test
#9
#10
_assert()toassert().In the future I will work on a cleaner/scalable way to test all the DrupalWebTestCase assertions.
#11
Looks good.
#12
I agree that it would be good to have some use cases in core. Can't think of any.
#13
The last submitted patch failed testing.
#14
Reroll from HEAD.
Back to previous status.
#15
The last submitted patch failed testing.
#16
teh bot?
#17
applied patch to D7 HEAD:
Hunk #1 succeeded at 336 (offset 40 lines).re-rolled for bot.
#18
The last submitted patch failed testing.