File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
main/kotlin/com/github/theapache64/retrosheet/utils
test/kotlin/com/github/theapache64/retrosheet/core
src/test/java/com/github/theapache64/retrosheet/integration Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,6 @@ object TypeIdentifier {
3131 }
3232
3333 fun isNumber (value : String ): Boolean {
34- return isDouble(value)
34+ return isDouble(value) || isInteger(value)
3535 }
3636}
Original file line number Diff line number Diff line change @@ -42,4 +42,17 @@ class QueryConverterTest {
4242 val actualOutput = QueryConverter (input, emptyMap(), paramMap).convert()
4343 actualOutput.should.equal(" SELECT * WHERE foo = 'a' AND bar = 'b'" )
4444 }
45+
46+ @Test
47+ fun `Strings are surrounded by single quotes and numbers are surrounded by nothing` () {
48+ val input =
49+ " SELECT * WHERE my_string = :my_string AND my_int = :my_int AND my_double = :my_double"
50+ val paramMap = mapOf (
51+ " my_string" to " com.truecaller" ,
52+ " my_int" to " 3" ,
53+ " my_double" to " 3.14"
54+ )
55+ val actualOutput = QueryConverter (input, emptyMap(), paramMap).convert()
56+ actualOutput.should.equal(" SELECT * WHERE my_string = 'com.truecaller' AND my_int = 3 AND my_double = 3.14" )
57+ }
4558}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class ReadTest {
1515
1616 @Test
1717 fun `Reads data` () = runBlockingTest {
18- notesApi.getNote(" Do not delete this row" )? .description.should
18+ notesApi.getNote(" Do not delete this row" ).description.should
1919 .equal(" This is custom desc" )
2020 Unit
2121 }
You can’t perform that action at this time.
0 commit comments