Skip to content

Assert a file matches a fixture on disk #32

@epage

Description

@epage
Contributor

Things to assert

  • file type
  • file content

others?

Activity

added this to the 0.5 milestone on Apr 27, 2018
changed the title [-]Assert a file matches a fixture version[/-] [+]Assert a file matches a fixture on disk[/+] on May 9, 2018
epage

epage commented on May 29, 2018

@epage
ContributorAuthor

Possible Requirements

  • Doesn't need to solve everything because we have from_path for people to do complex predicates
  • Defaults to loading as [u8] and checking equality
    • Handle large binary files (chunking) (from dir-diff issues)
  • Optionally enable text diffing
    • Normalize new lines (from dir-diff issues)
    • When messages are supported, show line diff (or word diff?)
  • Scale API for diffing directories?
epage

epage commented on May 29, 2018

@epage
ContributorAuthor

Possible API

  • eq_file(path): BinaryFilePredicate
  • eq_file(path).str(): StrFilePredicate
    • eq_file(path).str().normalize_eol(yes: bool)
epage

epage commented on May 29, 2018

@epage
ContributorAuthor

Background: we'll also want a directory matches a directory on disk

  • What can we reuse about the API, if any?

What if the API was instead eq_file(path, flags) where flags is a bitfield with the following

  • STR
  • NORMALIZE_EOL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @epage

      Issue actions

        Assert a file matches a fixture on disk · Issue #32 · assert-rs/predicates-rs