[nim] Refactoring tests to be more concise