From 6eb0a0b0c64de831b026e3c677f94d04eaab2f51 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Sat, 28 Oct 2023 14:47:04 +0200 Subject: [PATCH] =?UTF-8?q?Proc=C3=A9dure=20de=20test=20avec=20plusieurs?= =?UTF-8?q?=20cas=20dans=20le=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 71ac746..914b2af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,18 @@ mod parser; fn main() { - let command_line = String::from("ls -l"); + let commands: Vec<&str> = vec![ + "ls -l", + " amogus", + "lol ", + " fozafoazngin", + "amogus ", + "je suis fade up la", + " la c'est le bos final ", + ]; - let command_line_as_array: Vec = parser::parse(&command_line); - - println!("{:?}", command_line_as_array); + let commands_iter = commands.iter(); + for command in commands_iter { + println!("{:?}", parser::parse(&String::from(*command))); + } }