From the course: Using Rust with Python

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

Polars CLI test in Rust

Polars CLI test in Rust - Rust Tutorial

From the course: Using Rust with Python

Polars CLI test in Rust

- [Presenter] Here we have a Rust Polars project that has all these components; Command line tool interface, benchmarking, integration tests, cargo, et cetera, but in my particular demo, I'm going to talk about unit tests. It's easy to maybe be complacent with a language like Rust because it's so safe and effective and every time you work on it, almost everything works. You still, though, need to write some kind of a business logic unit test because of the fact that things can change, right? The business logic can change and so you're building a contract so that you know exactly what's happening with your code so in the future, if you're making a small change, it doesn't, you know, create a problem down the road. So let's go ahead and take a look at how that works in Rust. So if we go over to this project here, Polars-cli, we can see that there's the source code, the library right here, and I'm going to go ahead and take a look at this function. So this is a public function calculate…

Contents