Skip to content

Commit

Permalink
make test passes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephraim-nonso committed Dec 9, 2024
1 parent 3c90f2d commit 0df06b2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions exercises/practice/transpose/tests/transpose.cairo
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use transpose::transpose;
use transpose::transpose as transpose_matrix;

#[test]
fn empty_string() {
let mut input: Array<ByteArray> = array![];
let expected = array![];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -15,7 +15,7 @@ fn two_characters_in_a_row() {
let mut input: Array<ByteArray> = array!["A1"];
let expected = array!["A", "1"];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -25,7 +25,7 @@ fn two_characters_in_a_column() {
let mut input: Array<ByteArray> = array!["A", "1"];
let expected = array!["A1"];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -35,7 +35,7 @@ fn simple() {
let mut input: Array<ByteArray> = array!["ABC", "123"];
let expected = array!["A1", "B2", "C3"];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -45,7 +45,7 @@ fn single_line() {
let mut input: Array<ByteArray> = array!["Single line."];
let expected = array!["S", "i", "n", "g", "l", "e", " ", "l", "i", "n", "e", "."];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -72,7 +72,7 @@ fn first_line_longer_than_second_line() {
". "
];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -99,7 +99,7 @@ fn second_line_longer_than_first_line() {
" ."
];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand Down Expand Up @@ -129,7 +129,7 @@ fn mixed_line_length() {
". "
];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -139,7 +139,7 @@ fn square() {
let mut input: Array<ByteArray> = array!["HEART", "EMBER", "ABUSE", "RESIN", "TREND"];
let expected = array!["HEART", "EMBER", "ABUSE", "RESIN", "TREND"];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -149,7 +149,7 @@ fn rectangle() {
let mut input: Array<ByteArray> = array!["FRACTURE", "OUTLINED", "BLOOMING", "SEPTETTE"];
let expected = array!["FOBS", "RULE", "ATOP", "CLOT", "TIME", "UNIT", "RENT", "EDGE"];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -159,7 +159,7 @@ fn triangle() {
let mut input: Array<ByteArray> = array!["T", "EE", "AAA", "SSSS", "EEEEE", "RRRRRR"];
let expected = array!["TEASER", " EASER", " ASER", " SER", " ER", " R"];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

Expand All @@ -169,6 +169,6 @@ fn jagged_triangle() {
let mut input: Array<ByteArray> = array!["11", "2", "3333", "444", "555555", "66666"];
let expected = array!["123456", "1 3456", " 3456", " 3 56", " 56", " 5 "];

let output = transpose(input);
let output = transpose_matrix(input);
assert_eq!(output, expected);
}

0 comments on commit 0df06b2

Please sign in to comment.