Initial commit
This commit is contained in:
1
tests/config.nims
Normal file
1
tests/config.nims
Normal file
@@ -0,0 +1 @@
|
||||
switch("path", "$projectDir/../src")
|
||||
17
tests/test1_toSnakeCase.nim
Normal file
17
tests/test1_toSnakeCase.nim
Normal file
@@ -0,0 +1,17 @@
|
||||
# This is just an example to get you started. You may wish to put all of your
|
||||
# tests into a single file, or separate them into multiple `test1`, `test2`
|
||||
# etc. files (better names are recommended, just make sure the name starts with
|
||||
# the letter 't').
|
||||
#
|
||||
# To run these tests, simply execute `nimble test`.
|
||||
|
||||
import unittest
|
||||
import snake_case
|
||||
|
||||
test "toSnakeCase":
|
||||
check "toSnakeCase".toSnakeCase() == "TO_SNAKE_CASE"
|
||||
check "httpServerName".toSnakeCase() == "HTTP_SERVER_NAME"
|
||||
check "portNum".toSnakeCase() == "PORT_NUM"
|
||||
check "firstNameOnly".toSnakeCase() == "FIRST_NAME_ONLY"
|
||||
check "rostr.token".toSnakeCase() == "ROSTR_TOKEN"
|
||||
|
||||
17
tests/test2_fromSnakeCase.nim
Normal file
17
tests/test2_fromSnakeCase.nim
Normal file
@@ -0,0 +1,17 @@
|
||||
# This is just an example to get you started. You may wish to put all of your
|
||||
# tests into a single file, or separate them into multiple `test1`, `test2`
|
||||
# etc. files (better names are recommended, just make sure the name starts with
|
||||
# the letter 't').
|
||||
#
|
||||
# To run these tests, simply execute `nimble test`.
|
||||
|
||||
import unittest
|
||||
import snake_case
|
||||
|
||||
test "fromSnakeCase":
|
||||
check "TO_SNAKE_CASE".fromSnakeCase() == "toSnakeCase"
|
||||
check "HTTP_SERVER_NAME".fromSnakeCase() == "httpServerName"
|
||||
check "PORT_NUM".fromSnakeCase() == "portNum"
|
||||
check "FIRST_NAME_ONLY".fromSnakeCase() == "firstNameOnly"
|
||||
check "ROSTR_TOKEN".fromSnakeCase() == "rostrToken"
|
||||
|
||||
Reference in New Issue
Block a user