testing github action

This commit is contained in:
Rolf Martin Glomsrud 2023-03-03 20:06:40 +01:00
parent 427e5586d7
commit 63e8214974
2 changed files with 9 additions and 15 deletions

View file

@ -1,6 +1,4 @@
use crate::BarPlugin::Bar;
use crate::GuiHookVec;
use crate::GuiHookVec::GuiVec;
use crate::GuiHookVec::SortingList;
@ -9,9 +7,6 @@ use crate::GuiHookVec::SortingList;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::f32::consts::PI;
use std::hash::Hash;
#[derive(Debug, Clone)]
@ -34,6 +29,7 @@ impl Algorithm{
"binaryHeap" => Algorithm::binaryHeap(&mut list).await,
"quickSort" => Algorithm::quickSort(&mut list).await,
"radixSort" => Algorithm::radixSort(&mut list).await,
"stalinSort" => Algorithm::stalinSort(&mut list).await,
_ => panic!("No algorithm with that name implemented!")
}
@ -54,10 +50,8 @@ impl Algorithm{
}
}
/*
pub fn stalinSort(length:i32){
let mut list = GuiVec::new(screen_width(), screen_height(), length);
list.randomize();
pub async fn stalinSort(list:&mut impl SortingList){
let mut cur = 1;
loop{
@ -65,15 +59,17 @@ impl Algorithm{
break;
}
if list.lessThan(cur, cur-1){
list.delete(cur);
let mut temp = list.get(cur).clone();
temp.position = 0;
if list.set(cur, temp).await {return};
}else{
cur += 1;
}
yield list.clone();
}
}
*/
pub async fn bubbleSort(list:&mut impl SortingList){
let n = list.len();
@ -254,9 +250,6 @@ mod tests {
use super::*;
// ... the other async test
macro_rules! aw {
($e:expr) => {
tokio_test::block_on($e)

View file

@ -64,6 +64,7 @@ async fn main() {
algo = "radixSort";
}
if algo != ""{
Algorithm::Algorithm::run(length, 1.0, algo.to_string()).await;
}