Skip to content

doc: not clear how to test for one number less than another #711

Closed

Description

@shaunc

I assume I want to use Comparison somehow, but the documentation is quite unclear. What I want is (equivalent to):

  assert.LessThan(t, 3, 4). // passes
  assert.LessThan(t, 4, 3). // fails

Activity

  1. ollien commented on Mar 16, 2019

    @ollien

    For those who find this when googling (like I was), while master does include assertions for this, it is not present in the current release (1.3.0). The documentation reflects master, rather than the current release.

    If you want to do this in the current release, you can do something like this

    // Cannot call this more times than we have values for
    assert.True(t, func() bool {
    	return readCursor < len(pasteContents)
    }())
  2. kandros commented on May 18, 2019

    @kandros

    You can use assert.Less

    	assert.Less(t, 3, 4) // passes
    	assert.Less(t, 4, 3) // fails
    

    doc here

  3. ollien commented on May 18, 2019

    @ollien

    @kandros This is not present in the current release, only in master.

  4. KianYang-Lee commented on May 11, 2024

    @KianYang-Lee

    Shouldn'nt this be marked as closed? It's already documented here

  5. locked and limited conversation to collaborators on Oct 8, 2024
  6. converted this issue into a discussion #1659 on Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions