all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH proxmox-apt] tests: parse and write the result again
@ 2021-07-02  9:31 Fabian Ebner
  2021-07-02 11:05 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2021-07-02  9:31 UTC (permalink / raw)
  To: pve-devel

A cheap way to "double" the number of test cases.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 tests/repositories.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/repositories.rs b/tests/repositories.rs
index 289bbe4..67b0255 100644
--- a/tests/repositories.rs
+++ b/tests/repositories.rs
@@ -11,8 +11,15 @@ use proxmox_apt::repositories::{
 
 #[test]
 fn test_parse_write() -> Result<(), Error> {
+    test_parse_write_dir("sources.list.d")?;
+    test_parse_write_dir("sources.list.d.expected")?; // check if it's idempotent
+
+    Ok(())
+}
+
+fn test_parse_write_dir(read_dir: &str) -> Result<(), Error> {
     let test_dir = std::env::current_dir()?.join("tests");
-    let read_dir = test_dir.join("sources.list.d");
+    let read_dir = test_dir.join(read_dir);
     let write_dir = test_dir.join("sources.list.d.actual");
     let expected_dir = test_dir.join("sources.list.d.expected");
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH proxmox-apt] tests: parse and write the result again
  2021-07-02  9:31 [pve-devel] [PATCH proxmox-apt] tests: parse and write the result again Fabian Ebner
@ 2021-07-02 11:05 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-07-02 11:05 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Ebner

On 02.07.21 11:31, Fabian Ebner wrote:
> A cheap way to "double" the number of test cases.

"doubling" is a bit of a stretch but I get where you're coming from ;-) 
Parser self-tests are still always good to do additionally, ensuring a
stable serialization and de-serialization.

> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  tests/repositories.rs | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-02 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02  9:31 [pve-devel] [PATCH proxmox-apt] tests: parse and write the result again Fabian Ebner
2021-07-02 11:05 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal