From d9b4b399222b135821c1ef83a5ce8236b71d13ed Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 14 Jun 2023 13:30:31 +0200 Subject: [PATCH 1/2] Add trailing pipe to the snapshots so it doesn't end with trailing whitespace --- milli/src/snapshot_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/milli/src/snapshot_tests.rs b/milli/src/snapshot_tests.rs index 25c1088b9..158f515b8 100644 --- a/milli/src/snapshot_tests.rs +++ b/milli/src/snapshot_tests.rs @@ -318,7 +318,7 @@ pub fn snap_field_distributions(index: &Index) -> String { let rtxn = index.read_txn().unwrap(); let mut snap = String::new(); for (field, count) in index.field_distribution(&rtxn).unwrap() { - writeln!(&mut snap, "{field:<16} {count:<6}").unwrap(); + writeln!(&mut snap, "{field:<16} {count:<6} |").unwrap(); } snap } @@ -328,7 +328,7 @@ pub fn snap_fields_ids_map(index: &Index) -> String { let mut snap = String::new(); for field_id in fields_ids_map.ids() { let name = fields_ids_map.name(field_id).unwrap(); - writeln!(&mut snap, "{field_id:<3} {name:<16}").unwrap(); + writeln!(&mut snap, "{field_id:<3} {name:<16} |").unwrap(); } snap } From e0c4682758a754a1854bcf8868f2012c00d2a963 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 14 Jun 2023 13:30:14 +0200 Subject: [PATCH 2/2] Fix tests --- milli/src/index.rs | 18 +++++++++--------- .../1/field_distribution.snap | 6 +++--- .../field_distribution.snap | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/milli/src/index.rs b/milli/src/index.rs index 0d74e0732..1ccef13dd 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -1466,9 +1466,9 @@ pub(crate) mod tests { db_snap!(index, field_distribution, @r###" - age 1 - id 2 - name 2 + age 1 | + id 2 | + name 2 | "### ); @@ -1486,9 +1486,9 @@ pub(crate) mod tests { db_snap!(index, field_distribution, @r###" - age 1 - id 2 - name 2 + age 1 | + id 2 | + name 2 | "### ); @@ -1502,9 +1502,9 @@ pub(crate) mod tests { db_snap!(index, field_distribution, @r###" - has_dog 1 - id 2 - name 2 + has_dog 1 | + id 2 | + name 2 | "### ); } diff --git a/milli/src/snapshots/index.rs/initial_field_distribution/1/field_distribution.snap b/milli/src/snapshots/index.rs/initial_field_distribution/1/field_distribution.snap index 9b074fb59..1d1d629e6 100644 --- a/milli/src/snapshots/index.rs/initial_field_distribution/1/field_distribution.snap +++ b/milli/src/snapshots/index.rs/initial_field_distribution/1/field_distribution.snap @@ -1,7 +1,7 @@ --- source: milli/src/index.rs --- -age 1 -id 2 -name 2 +age 1 | +id 2 | +name 2 | diff --git a/milli/src/snapshots/index.rs/initial_field_distribution/field_distribution.snap b/milli/src/snapshots/index.rs/initial_field_distribution/field_distribution.snap index 9b074fb59..1d1d629e6 100644 --- a/milli/src/snapshots/index.rs/initial_field_distribution/field_distribution.snap +++ b/milli/src/snapshots/index.rs/initial_field_distribution/field_distribution.snap @@ -1,7 +1,7 @@ --- source: milli/src/index.rs --- -age 1 -id 2 -name 2 +age 1 | +id 2 | +name 2 |