mirror of
https://github.com/LukasKalbertodt/programmieren-in-rust.git
synced 2026-05-05 06:51:12 +02:00
Rename sheet folders to assure proper sorting
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
use Vector2;
|
||||
|
||||
#[test]
|
||||
fn constructors() {
|
||||
assert_eq!(Vector2::new(27, 42), Vector2 { x: 27, y: 42 });
|
||||
assert_eq!(Vector2::origin(), Vector2 { x: 0, y: 0 });
|
||||
assert_eq!(Vector2::unit_x(), Vector2 { x: 1, y: 0 });
|
||||
assert_eq!(Vector2::unit_y(), Vector2 { x: 0, y: 1 });
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn operators() {
|
||||
let a = Vector2::new(3, 7);
|
||||
let b = Vector2::new(-2, 5);
|
||||
|
||||
assert_eq!(a + b, Vector2::new(1, 12));
|
||||
assert_eq!(a * 2, Vector2::new(6, 14));
|
||||
}
|
||||
Reference in New Issue
Block a user