kurozakizz / go-tdd-string-calculator

golang tdd string calculator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang TDD String Calculator

golang tdd string calculator

Add() function will split number from string with separator and return sum of numbers

Test Case

  • input "" shoud return 0
  • input "1" should return 1
  • input "1,2" should return 3
  • input "1\n2" should return 3
  • input "1\n2,3" should return 6
  • input "1\n,2,3" should error "Not need to prove it, just clarifying"

About

golang tdd string calculator


Languages

Language:Go 100.0%