-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a snakifyColumns method that uses the snakify method defined in t…
…he Lyft web development framework
- Loading branch information
Showing
7 changed files
with
122 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
src/test/scala/com/github/mrpowers/spark/daria/utils/StringHelpersSpec.scala
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/test/scala/com/github/mrpowers/spark/daria/utils/StringHelpersTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.mrpowers.spark.daria.utils | ||
|
||
import utest._ | ||
|
||
object StringHelpersTest extends TestSuite { | ||
|
||
val tests = Tests { | ||
|
||
'escapeForSqlRegexp - { | ||
assert(StringHelpers.escapeForSqlRegexp("D/E") == Some("D\\/E")) | ||
assert(StringHelpers.escapeForSqlRegexp("(E/F)") == Some("\\(E\\/F\\)")) | ||
assert(StringHelpers.escapeForSqlRegexp("") == Some("")) | ||
assert(StringHelpers.escapeForSqlRegexp("E|G") == Some("E\\|G")) | ||
assert(StringHelpers.escapeForSqlRegexp("E;;G") == Some("E;;G")) | ||
assert(StringHelpers.escapeForSqlRegexp("^AB-C") == Some("^AB\\-C")) | ||
assert(StringHelpers.escapeForSqlRegexp("^AB+C") == Some("^AB\\+C")) | ||
assert(StringHelpers.escapeForSqlRegexp(null) == None) | ||
} | ||
|
||
'toSnakeCase - { | ||
assert(StringHelpers.toSnakeCase("A b C") == "a_b_c") | ||
} | ||
|
||
'snakify - { | ||
assert(StringHelpers.snakify("SomeColumn") == "some_column") | ||
} | ||
|
||
'camelCaseToSnakeCase - { | ||
assert(StringHelpers.camelCaseToSnakeCase("thisIsCool") == "this_is_cool") | ||
} | ||
|
||
} | ||
|
||
} |