Skip to content

twgophers/runes

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Runes: baby steps with TDD

In this repo you can follow the step-by-step development of the runes example: a Go command-line utility to find Unicode characters by name.

Each step in the development is documented explaining the Go language features used in the code. We follow the TDD (Test Driven Design) method, so we code a test and then implement the functionality being tested. This makes it easier to focus on the what (the interface) before we think about the how (the implementation).

You don't need to know Go to follow along. The only pre-requsite is to know programming in another language.

Our goal

At the end of this tutorial, we'll have a command-line too which allows searching for Unicode characters, like emoji, by typing words that appear in the character name. For example:

$ runes face eyes
U+1F601	😁	GRINNING FACE WITH SMILING EYES
U+1F604	πŸ˜„	SMILING FACE WITH OPEN MOUTH AND SMILING EYES
U+1F606	πŸ˜†	SMILING FACE WITH OPEN MOUTH AND TIGHTLY-CLOSED EYES
U+1F60A	😊	SMILING FACE WITH SMILING EYES
U+1F60D	😍	SMILING FACE WITH HEART-SHAPED EYES
U+1F619	πŸ˜™	KISSING FACE WITH SMILING EYES
U+1F61A	😚	KISSING FACE WITH CLOSED EYES
U+1F61D	😝	FACE WITH STUCK-OUT TONGUE AND TIGHTLY-CLOSED EYES
U+1F638	😸	GRINNING CAT FACE WITH SMILING EYES
U+1F63B	😻	SMILING CAT FACE WITH HEART-SHAPED EYES
U+1F63D	😽	KISSING CAT FACE WITH CLOSED EYES
U+1F644	πŸ™„	FACE WITH ROLLING EYES

Give the runes command one or more words, and it returns a sorted list of all Unicode characters containing those words in their names.

To get started, go to the project page.

Credits

This tutorial is based on the charfinder example from chapter 18 of Fluent Python, by Luciano Ramalho. The Go version called runefinder was started in the Garoa Gophers study group: Afonso Coutinho (@afonso), Alexandre Souza (@alexandre), Andrews Medina (@andrewsmedina), JoΓ£o "JC" Martins (@jcmartins), Luciano Ramalho (@ramalho), Marcio Ribeiro (@mmr) and Michael Howard.

About

πŸ”£ Building the `runes` command with TDD in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%