site/blog/time-regex-testing-2020-10-...

33 lines
1.0 KiB
Markdown
Raw Normal View History

2020-10-11 14:09:33 +00:00
---
title: Time, Regexes and Testing
date: 2020-10-04
series: rust-for-gophers
tags:
- rust
---
# Time, Regexes and Testing
Previously on [Rust for Gophers](/blog/series/rust-for-gophers) (name is a work
in progress, ideas would be lovely) we covered logging, templating and basic
HTTP client/server operations. Go's standard library also has support from some
other things too, such as time handling, regular expressions and unit testing.
Today we are going to cover their analogs in Rust.
## Testing
Programs have a tendency to not do what you want when you write them. Sometimes
it's worth trying to see what code actually does and make sure it's what you
want it to do. This can help a lot when you are ensuring that types are
converted, the right HTTP responses are returned and that any other effects are
what you want.
[We plan to go into much more detail about this in the future, however this is
just enough about how testing in Rust works to help show these
examples.](conversation://Mara/hacker)
## Time
## Regexes