I like it. Having for example one $mocked_vmlist is clean. Two ideas for further testing (in the future): - Passing only a subset of $types to list_volumes - Unintended situations, like when $mocked_vmlist has a VM without type => list_volumes roughly does if (defined($type) && $type eq 'lxc') ... else ...
On Wed, Apr 22, 2020 at 04:58:00PM +0200, Alwin Antreich wrote: > Test to reduce the potential for accidental breakage on regex changes. > > Co-Authored-by: Dominic Jaeger <d.jae...@proxmox.com> > Signed-off-by: Alwin Antreich <a.antre...@proxmox.com> > --- > test/list_volumes_test.pm | 519 ++++++++++++++++++++++++++++++++++++++ > test/run_plugin_tests.pl | 6 +- > 2 files changed, 524 insertions(+), 1 deletion(-) > create mode 100644 test/list_volumes_test.pm > > diff --git a/test/list_volumes_test.pm b/test/list_volumes_test.pm > new file mode 100644 > index 0000000..c1428f2 > --- /dev/null > +++ b/test/list_volumes_test.pm > @@ -0,0 +1,519 @@ > +package PVE::Storage::TestListVolumes; > + > +use strict; > _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel