Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add tests for BandAid and Suggestions, fix #18 #46

Closed
wants to merge 20 commits into from

Conversation

KuabeM
Copy link
Collaborator

@KuabeM KuabeM commented Jun 18, 2020

What does this PR accomplish?

Bugfix: closes #18 .

Changes proposed by this PR:

Added unit tests for BandAid to find root cause of #18

Notes to reviewer:

This is a very early draft. I just started adding some tests. I need more thorough understanding of the internals of Suggestion and the corresponding processing of from Strings/Literals into BandAids.

Contributor Checklist

  • cargo test
  • Run cargo spellcheck on the demo dir and verify output manually
  • cargo fix && cargo fmt
  • cargo spellcheck on the source tree (optional)

Reviewer Checklist

  • Code reviewed
  • Tests reviewed
  • Documentation reviewed

@drahnr
Copy link
Owner

drahnr commented Jun 18, 2020

It's kinda shitty, but gives an overview how things work


                              Documentation

                         +---------------------+
                         |                     |
                         |     LiteralSets     |
                         |  +------------+     |                      +----------------+
   +--------------+      |  |----------------+ |                      |                |
   |              |      |  |---------------------------------------->+   checker1     +------------+
   |              |      |  |--|Literal  |-| | |                      |                |            v
   |   rust       |      |  |--|Literal  |-| | |                      +----------------+          +-------------+
   |              +------------|Literal  |-| | |                                                  |             |
   |              |      |  |--|  +      |-| | |                                                  |  suggestion |
   |              |      |  |--|  |      |-| | |                      +----------------+          +--^----------+
   |              |      |  |--|  |      |--------------------------->+                |             |     |
   |              |      |  |--|  |      |-| | |                      |   checker2     +-------------+     |
   |              |      |  |--------------| | |                      |                |                   |
   |              |      |  +--------------| | |                      +----------------+                   |
   |              |      |     +-------------+ |                                                           |
   +----^---------+      |        |            |                                                           |
        |                |        |            |                                                           |
        |                +---------------------+                                                           |  user picks
        |                         |                                                                        |
        |                         |                                                                        |  replacement
        |                         |                                                                        |
        |                         |                                                                        |
        |                         |                                                                        |
        |                         |                                                                        |
        |                         |                                                                        |
        |                         |                                                                        |
        |                         |                                                                        |
        |                         |                                                                        |
        |                         | original literal span                                                  v
        |                         |                                                                 +----------------+
        |                         |                                                                 |                |
        |                         |                                                                 |                |
        |                         |                                                                 |                |
        |                         |                                                                 |                |
        |                         |                                                                 +----------------+
        |                         |                                                                       |
        |                         |                                                                       |
        |                         |                                                                       |
        |                         |                                                                       |
        |                  +----<-+                                                                       |
        |        BandAid |   |                             range/span within the extracte literal str   |
      <--------------------+   +<-------------------------------------------------------------------------+
                           |   |
                           +---+

@drahnr drahnr mentioned this pull request Jun 19, 2020
@KuabeM
Copy link
Collaborator Author

KuabeM commented Jun 20, 2020

closed in favor of #53

@KuabeM KuabeM closed this Jun 20, 2020
@drahnr drahnr mentioned this pull request Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

applying replacements to #[doc = r"..."] fails
2 participants