Write Unit Tests in Rust 🦀 Rust Programming Tutorial for Developers

Ғылым және технология

In this video, we'll be exploring how you can write unit tests in Rust. Unit tests help you to write more robust code, and release better quality software. Rust makes writing unit tests incredibly easy, since tests just Rust functions. There are a couple of attributes you'll want to be aware of, and several methods of structuring your test code. You can incorporate your tests into the same code file that defines the code that will be tested, or you can separate your tests into separate modules.
🚨📦 Help support this channel - shop through my Amazon storefront!
⬇️⬇️⬇️
www.amazon.com/shop/trevorsul...
⬆️⬆️⬆️
🤯 Rust Programming Playlist 🦀 • Rust Programming Tutor...
📖 How to Write Rust Unit Tests 📦➡️ doc.rust-lang.org/book/ch11-0...
Visual Studio Code ➡️ code.visualstudio.com
Rust Website ➡️ rust-lang.org
Rustup Installer ➡️ rustup.rs
Rust Docs ➡️ doc.rust-lang.org/book
Please follow me on these other social channels!
➡️ trevorsullivan.net
➡️ github.com/pcgeek86
➡️ / pcgeek86
➡️ / trevorsullivan
➡️ / trevorsoftware
➡️ tiktok.com/pcgeek86
All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names,trademarks and brands does not imply endorsement.
#rustlang #rust #rustdev #opensource #software #linux #devops #programming #rusty #dev #coding #codinglife #code #coder #ubuntu #ubuntulinux #appdev #developer

Пікірлер: 25

  • @frezze9314
    @frezze93147 күн бұрын

    Excellent material. Have about 8 months of Rust exposure. This helps solidify the concepts.

  • @shahidyousuf9464
    @shahidyousuf9464Ай бұрын

    Kindly provide a detailed video on lifetimes. Appreciate the effort you put in to make our learning effortless.

  • @EddieKingara
    @EddieKingaraАй бұрын

    My Brudda!! May the good lord bless you in every way possible!!

  • @MegaAnufriev
    @MegaAnufriev6 ай бұрын

    It would be great to see a video on mocking in rust. Which mocking libraries are best for most common scenarios. Is mocking idiomatic in rust at all?

  • @eligbuefelix7988
    @eligbuefelix79887 ай бұрын

    I love this channel, thanks a lot Trevor

  • @wagnernoise
    @wagnernoise8 ай бұрын

    Thanks for the video, really great explanation!

  • @yasin5058
    @yasin50587 ай бұрын

    Great video. I‘d love to watch a video about integration tests,

  • @TrevorSullivan
    @TrevorSullivan8 ай бұрын

    🚨📦 Help support this channel - shop through my Amazon storefront! ⬇⬇⬇ www.amazon.com/shop/trevorsullivan ⬆⬆⬆

  • @theintjengineer
    @theintjengineer8 ай бұрын

    You're killing with these videos👌🏽 Keep them coming and let's hope the algorithm blesses you🙌🏽 Thank you so much.

  • @TrevorSullivan

    @TrevorSullivan

    8 ай бұрын

    Thank you so much for your support! ♥️

  • @theintjengineer

    @theintjengineer

    8 ай бұрын

    @@TrevorSullivan, why don't you create a D*ïs*ćord Server? [not sure KZread allows these names here haha] Let's build a community, Mate🙌🏽 Your content is top-notch and you're knowledgeable in several areas. I can't see this channel not booming 💣💥👌🏽 I, personally, loved that Rust and AWS Mixup you introduced. I'm sure many people will want to see more on that. If you need help or something [not on Rust or AWS though, since I'm learning that from you😂], just lemme know and I'll send you an email/add you somewhere, whatever. I'm really rooting for you. Cheers.

  • @TrevorSullivan

    @TrevorSullivan

    8 ай бұрын

    @@theintjengineer you rock, thank you for the idea and being willing to support the community! Since I haven't had much time to focus on KZread for the last month, I'm not sure adding more overhead is a great idea right now. Depending on how things go long-term, that could definitely be part of the picture though! Chat can sometimes be a bit much to keep on top of, but a discussion forum could be helpful. Do you like Discourse? What topics are you most comfortable with (if not AWS and Rust)?

  • @theintjengineer

    @theintjengineer

    8 ай бұрын

    - I guess CMake Discourse is the only Discourse I have ever used haha. Though I didn't actually dislike it. I found it ok. So, that wouldn't be a problem. - Electrical Engineering, C++ and, a couple of months ago, I started getting into Cybersecurity, so, I know a bit about that as well. But again, the day only has 24h, right?!! Haha There's way more I'd like to learn, but I'll focus on a Cloud Technology for now and some DevOps stuff, like Docker. That's stuff I don't yet know and which I'd like to have fundamental knowledge of. Anyways. I'll keep following the channel and let's see how this all goes. Cheers.

  • @TrevorSullivan

    @TrevorSullivan

    8 ай бұрын

    @@theintjengineer Those are some awesome skills. I wish I had more background in hardware, honestly. You could start your own KZread channel. :) Docker is a great tool to learn. I wouldn't worry too much about Kubernetes, as it's often overkill for whatever devs are trying to accomplish. Check out some git servers though, like OneDev, Gitea, Forgejo, and similar tool. Check out Terraform for deploying cloud resources en masse. Check out PowerShell for gluing services together easily. There's a ton to learn out there! I hear you about only having 24h each day. 😆🦀

  • @saurabtharu7252
    @saurabtharu72527 ай бұрын

    Hey Trevor, please make a video on error reporting library named "miette" btw really appreciate your contents👌. They have always been so much helpful for me 😇

  • @datawolk
    @datawolk7 ай бұрын

    Nice one. Could you make a video about a multi file/module project? Proper imports etc

  • @TrevorSullivan

    @TrevorSullivan

    7 ай бұрын

    That is an excellent topic! I already have a video on modules, but there is a definite need to go into more depth on nested crates, workspaces, and import/use statements. I agree wholeheartedly!!

  • @TrevorSullivan

    @TrevorSullivan

    7 ай бұрын

    @datawolk Just published a new video about multi-crate Rust projects! Check out the playlist!

  • @datawolk

    @datawolk

    7 ай бұрын

    Thanks a lot! Never heard of workspaces before.

  • @user-ui8my9zs7o
    @user-ui8my9zs7o6 ай бұрын

    Where do you put test files at?

  • @prajganesh
    @prajganesh3 ай бұрын

    Now that you wrote a few AWS videos with Rust, what's you take on it? I'm still debating if I should play with Rust or Golang. I do mostly for fun to learn different things. But still not able to decide between Rust and Golang.

  • @TrevorSullivan

    @TrevorSullivan

    3 ай бұрын

    Hey @prajganesh, great question. I have to say that I really like Rust, after working with it for ~9 months now. I would strongly recommend it to anyone who's interested in software development. The efficiency of CPU and memory resources is incredible. Also, specifically around AWS, check out the cold start performance of Rust compared to Golang on this website: maxday.github.io/lambda-perf/ Rust is almost 3x faster than Go at cold starts! If you need responsive applications that "feel" fast to your users, Rust is the way to go.

  • @prajganesh

    @prajganesh

    3 ай бұрын

    It's funny as I was watching interview :) For me it's more to create some proof of concept. I don't intend to create any production code. But youtube is full of Python and Golang, so Rust is a niche space

  • @TrevorSullivan

    @TrevorSullivan

    3 ай бұрын

    @@prajganesh Rust is definitely more niche, I agree, but there's lots of momentum behind it. 🦀🙂 Microsoft, Amazon, and Google are all investing in it.

  • @TheInspctrcat
    @TheInspctrcat7 ай бұрын

    I guess more idiomatic way is format macro

Келесі