sunjay / turtle

Create Animated Drawings in Rust
http://turtle.rs
Mozilla Public License 2.0
562 stars 53 forks source link

Make Turtle Testable #6

Closed sunjay closed 7 years ago

sunjay commented 7 years ago

This is necessary in order to make doctests actually useful and viable.

Idea: Using #[cfg(test)] to replace the definition of Turtle with something that has a test/mock window. Make that mock window do all the same stuff as TurtleWindow but with no piston stuff. This will require abstracting out a lot of the calculations that TurtleWindow and animation do.