-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug where
indentation_context
stack's size is not decreasing
- Loading branch information
Showing
3 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ mod anyhow_case_test; | |
|
||
#[cfg(test)] | ||
mod rustpython_case_test; | ||
|
||
#[cfg(test)] | ||
mod serde_case_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#[cfg(test)] | ||
mod serde_case_test { | ||
use indoc::indoc; | ||
use crate::integration_test::assert_analyzed_source_code; | ||
|
||
#[test] | ||
fn test_several_impl_declaration() { | ||
let source_code = indoc! {" | ||
impl PartialEq<Symbol> for Ident { | ||
fn eq(&self, word: &Symbol) -> bool { | ||
self == word.0 | ||
} | ||
} | ||
impl<'a> PartialEq<Symbol> for &'a Ident { | ||
fn eq(&self, word: &Symbol) -> bool { | ||
*self == word.0 | ||
} | ||
} | ||
impl PartialEq<Symbol> for Path { | ||
fn eq(&self, word: &Symbol) -> bool { | ||
self.is_ident(word.0) | ||
} | ||
}"}; | ||
|
||
let result = indoc! {" | ||
/// [TODO] | ||
impl PartialEq<Symbol> for Ident { | ||
/// [TODO] | ||
fn eq(&self, word: &Symbol) -> bool { | ||
self == word.0 | ||
} | ||
} | ||
/// [TODO] | ||
impl<'a> PartialEq<Symbol> for &'a Ident { | ||
/// [TODO] | ||
fn eq(&self, word: &Symbol) -> bool { | ||
*self == word.0 | ||
} | ||
} | ||
/// [TODO] | ||
impl PartialEq<Symbol> for Path { | ||
/// [TODO] | ||
fn eq(&self, word: &Symbol) -> bool { | ||
self.is_ident(word.0) | ||
} | ||
}"}; | ||
|
||
assert_analyzed_source_code(source_code, result, "rust") | ||
} | ||
} |