All Questions
Tagged with unit-testing regex
12 questions
3
votes
1
answer
102
views
Build a dictionary from a string by the extraction of data from all the pairs <TAG|VAL> contained inside the string and clean string from TAGs
I have written code to manage a string and retrieve from it a dictionary which must contain pairs key-value dependent from the string.
To be more clear I'll show ...
2
votes
1
answer
134
views
Newspaper Bill Calculator CLI with Python (1 of 3, Core)
Code is posted after explanation.
Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused.
Post 2 of 3, CLI: Newspaper Bill ...
4
votes
2
answers
210
views
Attempt at Perl transliteration function in JavaScript with flags
I've been trying to rewrite the perl transliteration function in javascript. This isn't a complete replication, and I haven't looked at the perl source code... I took inspiration from this question ...
10
votes
1
answer
1k
views
Osherove TDD Kata 1: String Calculator
I implemented Roy Osherove's TDD Kata 1: String Calculator using Python 3.5.2 and the unittest module. The full description can be found at the link, it's a bit ...
10
votes
2
answers
539
views
Command Tokenizer
I've written some code to tokenize a command string into its tokens.
A token is either:
A block of any non-whitespace characters
A block of characters, which may include whitespace, wrapped in quotes
...
7
votes
1
answer
78
views
Python App that parses file for lines that match a format
I recently wrote some code that was dinged on not having well defined tests and poor modularity. Was hoping someone could review my code and give me pointers on how to create more well-defined tests (...
11
votes
3
answers
4k
views
Number to Roman numerals
I've been working on numerals conversion lately. Now the JavaScript course I'm following asked me to do something similar for Roman numerals.
To keep things fresh and given the amount of test-cases ...
11
votes
1
answer
2k
views
Tokenize s-expressions in Rust
I'm writing an s-expression tokenizer in Rust.
I have the following code written, but it is not idiomatic Rust - it is quite ugly. TokenizerI is simply an ...
2
votes
1
answer
1k
views
TDD: String Calculator Kata
String Calculator
Create a simple String calculator with a method int Add(string numbers).
The method can take 0, 1 or 2 numbers, and will return ...
32
votes
10
answers
4k
views
What are some indicators that I was over-thinking my solution to this problem?
This question is a cross between career question and a code review. I was uncertain where to ask, but since there is code involved I went with CodeReview.
I’m going through the process of technical ...
1
vote
2
answers
859
views
Checking name E-mail and unit-test
Please tell me what you think. Is my code bad?
Function checking
...
2
votes
3
answers
8k
views
Regular Expression to remove blank lines
This is basically my first Ruby class, which is to remove all empty lines and blank times from a .txt file. A simple test case is also included.
I tested the code and it works fine. But I did not ...