Skip to content

Cerberus tables tests #154

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

capoferro
Copy link
Contributor

(depends on #150)

Add some simple tests for Markdown table parsing.

mcy and others added 12 commits November 15, 2021 14:30
Signed-off-by: Miguel Young de la Sota <[email protected]>
Signed-off-by: Miguel Young de la Sota <[email protected]>
Signed-off-by: Miguel Young de la Sota <[email protected]>
Signed-off-by: Miguel Young de la Sota <[email protected]>
Signed-off-by: Miguel Young de la Sota <[email protected]>
Signed-off-by: Josiah Kiehl <[email protected]>
@capoferro capoferro changed the title Cerberus tables Cerberus tables tests Jan 7, 2022
@mcy
Copy link
Contributor

mcy commented Jan 10, 2022

Go ahead and rebase when you get a chance (I'll review as-is anyways).

Copy link
Contributor

@mcy mcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd squash this into the previous and call it "fixed typo".

@@ -271,7 +283,7 @@ pub enum TypeKind<'md> {

/// A row of a [`Table`] with values of type `Type`.
#[derive(Clone, Debug)]
pub struct TableRow<'md, Type> {
pub struct TableRow<'md, Type: std::fmt::Debug> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this bound need to be here? I think it can be moved somewhere else.

@@ -334,6 +346,12 @@ pub struct Error<'md> {
pub kind: ErrorKind,
}

impl std::fmt::Display for Error<'_> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a use for std::fmt and use just the fmt prefix?

}

#[test]
fn markdownfile_parse_tables() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I might recommend for when we add more tests is to do something like rustc's UI tests: https://github.com/rust-lang/rust/blob/master/src/test/ui/fn/fn-recover-return-sign2.rs#L5

The idea being that this makes it easier to find spans instead of having to hand-code them, which can be quite painful. You can pull in files via include_str!().

@@ -135,7 +135,7 @@ impl<'md> Ident<'md> {
self.0
}

/// Returns the textual content of the wrapped Span.
/// Returns the textual content of the wrapped [`Span'].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be [`Span`]; note both are backticks. Rustdoc parses these automatically.

@mcy
Copy link
Contributor

mcy commented Jan 10, 2022

Also: could you rename your commits to all start with [tables]? Thanks!

@moidx moidx removed request for cfrantz and moidx January 10, 2022 22:08
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.

2 participants