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

Fixed deleting entities from lists with special characters #6561

Open
wants to merge 2 commits into
base: v2024.3.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,27 @@ abstract class EntitiesRepositoryTest {
)
}

@Test
fun `#delete supports list names with dots and dashes`() {
val repository = buildSubject()

val leoville = Entity.New("1", "Léoville Barton 2008")

repository.save("wines.x", leoville)
repository.save("wines-x", leoville)

repository.delete("1")
Copy link
Member

Choose a reason for hiding this comment

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

This makes me realize that delete should probably take a list as an arg as well, but that's for another time!


assertThat(
repository.getEntities("wines.x").isEmpty(),
equalTo(true)
)
assertThat(
repository.getEntities("wines-x").isEmpty(),
equalTo(true)
)
}

@Test
fun `#delete updates index values so that they are always in sequence and start at 0`() {
val repository = buildSubject()
Expand Down