Skip to content

Mat3: implemented the toString() method#76

Open
ulukbek-s wants to merge 4 commits into
toksaitov:devfrom
ulukbek-s:dev
Open

Mat3: implemented the toString() method#76
ulukbek-s wants to merge 4 commits into
toksaitov:devfrom
ulukbek-s:dev

Conversation

@ulukbek-s

Copy link
Copy Markdown
Collaborator

No description provided.

* Create a test/s for a method 'toString()' to convert the matrix into a String
* Pass the test/s for the 'toString()' method
@ulukbek-s ulukbek-s linked an issue Dec 25, 2023 that may be closed by this pull request
2 tasks
Comment thread lib/src/main/java/vmath/Mat3.java Outdated
Comment on lines +62 to +64
return "(" + m[0] + ", " + m[1] + ", " + m[2] + ")\n" +
"(" + m[3] + ", " + m[4] + ", " + m[5] + ")\n" +
"(" + m[6] + ", " + m[7] + ", " + m[8] + ")";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation

Comment on lines +158 to +169
void whenToStringCalled_thenReturnsStringRepresentation() {
var m = new Mat3(
1.0f, 2.0f, 3.0f,
4.0f, 5.0f, 6.0f,
7.0f, 8.0f, 9.0f
);
String expected = "(1.0, 2.0, 3.0)\n" +
"(4.0, 5.0, 6.0)\n" +
"(7.0, 8.0, 9.0)";

assertEquals(expected, m.toString());
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look how the Mat2 toString tests were done and do the same.

@ulukbek-s ulukbek-s requested a review from toksaitov January 7, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mat3: implement the toString() method

4 participants