Skip to content

buffer.expect needs to adapt to the try catch notation #631

@Lampese

Description

@Lampese

Now there is a section in buffer_test.mbt:

test "expect method with matching content" {
  let buf = Buffer::make(100)
  buf.write_string("Test")
  buf.expect(content="Test")?
}

test "expect method with non-matching content" {
  let buf = Buffer::make(100)
  buf.write_string("Test")
  buf.expect(content="Test")?
}

This is because the -u parameter of moon will update the expected result, while the return value of buffer.expect is still a Result that cannot be thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions