Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update two-fer to match canonical data #142

Merged
merged 1 commit into from Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/practice/two-fer/.meta/example.gleam
@@ -1,5 +1,5 @@
import gleam/option.{Option}

pub fn two_fer(name: Option(String)) -> String {
"One for " <> option.unwrap(name, "you") <> ", one for me"
"One for " <> option.unwrap(name, "you") <> ", one for me."
}
15 changes: 10 additions & 5 deletions exercises/practice/two-fer/test/two_fer_test.gleam
Expand Up @@ -7,12 +7,17 @@ pub fn main() {
gleeunit.main()
}

pub fn no_name_test() {
pub fn no_name_given_test() {
two_fer(None)
|> should.equal("One for you, one for me")
|> should.equal("One for you, one for me.")
}

pub fn with_name_test() {
two_fer(Some("Gilberto Barros"))
|> should.equal("One for Gilberto Barros, one for me")
pub fn a_name_given_test() {
two_fer(Some("Alice"))
|> should.equal("One for Alice, one for me.")
}

pub fn another_name_given_test() {
two_fer(Some("Bob"))
|> should.equal("One for Bob, one for me.")
}