Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

fix attrset merging for >= 3 instances #96

Merged
merged 1 commit into from
Sep 17, 2022

Conversation

symphorien
Copy link
Contributor

Summary & Motivation

Before:

image

this happens for >= 3 instances of a

Further context

@symphorien symphorien force-pushed the merge3 branch 2 times, most recently from ec0f8a0 to b971524 Compare July 26, 2022 21:55
Copy link
Member

@aaronjanse aaronjanse left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @symphorien! I left a few comments

src/eval.rs Outdated Show resolved Hide resolved
src/eval.rs Outdated Show resolved Hide resolved
Comment on lines +299 to +306
#[test]
fn attrs_merge_3() {
let code = "{ a.b = 1; a.c = 2; a.d = 3; }".to_string();
assert_eq!(eval(&format!("{}.a.b", code)).as_int().unwrap(), 1);
assert_eq!(eval(&format!("{}.a.c", code)).as_int().unwrap(), 2);
assert_eq!(eval(&format!("{}.a.d", code)).as_int().unwrap(), 3);
}

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for adding a test!

src/tests.rs Show resolved Hide resolved
@symphorien
Copy link
Contributor Author

ping @aaronjanse

@aaronjanse
Copy link
Member

LGTM. Thanks @symphorien!

@aaronjanse aaronjanse merged commit 6925256 into nix-community:master Sep 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants