{"size": 1004, "ext": "scrbl", "max_stars_repo_path": "testing-utils/scribblings/testing-utils.scrbl", "max_stars_repo_name": "AlexKnauth/testing-utils", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "testing-utils/scribblings/testing-utils.scrbl", "max_issues_repo_name": "AlexKnauth/testing-utils", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "testing-utils/scribblings/testing-utils.scrbl", "max_forks_repo_name": "AlexKnauth/testing-utils", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.375, "max_line_length": 99, "alphanum_fraction": 0.6743027888}
#lang scribble/manual

@(require (for-label testing-utils
                     racket/base
                     racket/contract/base
                     ))

@title{Testing Utilities}

@defmodule[testing-utils]

@defproc[(check-within [actual any/c] [expected any/c] [ok-delta (and/c real? (not/c negative?))])
         void?]{
A @racketmodname[rackunit] check form for checking values that might
have numbers somewhere inside them that are close enough, but aren't
exactly equal.
}

@defproc[(equal?/within [actual any/c] [expected any/c] [ok-delta (and/c real? (not/c negative?))])
         boolean?]{
A predicate version of @racket[check-within] that returns true on
success and false on failure.
}

@defform[(with-loc loc form)]{
A utility for making your own testing macros that report the right
source location for check failures. It simply returns @racket[form],
but with the source location of @racket[loc]. In macros, it is an
alternative to @racket[#`(.... #,(syntax/loc #'loc form) ....)].
}

