freenode/lisp - IRC Chatlog
Search
8:04:19
shka_
contains definition for system "cl-ppcre-test". Please only define "cl-ppcre" and secondary systems with a name starting with "cl-ppcre/" (e.g. "cl-ppcre/test") in that file
8:58:10
splittist
That's an asdf warning. At some point it became fussy about, as it says, defsystems in the same file. So you would define (defsystem #:trivial-example (...)) and (defsystem #:trivial-example/tests (...)) But perhaps you meant something else.
16:37:37
raeda
As in code coverage? The cookbook might have what you're looking for https://lispcookbook.github.io/cl-cookbook/testing.html#code-coverage
16:58:30
phoe
shka_: a method? sounds like a job for a toplevel :AROUND, as long as your code does not use that internally
17:00:07
kagevf
CL-ASHOK did you try looking at this? https://marijnhaverbeke.nl/postmodern/postmodern.html
17:02:10
CL-ASHOK
kagevf I did, but it's hard to follow "This is the macro-style variant of prepare. It is like prepare, but gives the function a name which now becomes a top-level function for the prepared statement. The name should not a string but may be quoted."
17:03:26
CL-ASHOK
Does something like this: (doquery (:select 'x 'y :from 'some-imaginary-table) (x y)
17:03:37
kagevf
CL-ASHOK: there are a few examples using the argument placeholders like $1 ... maybe enough to figure out how to apply to your code ...
17:04:36
kagevf
CL-ASHOK: that doquery in your example you just wrote doesn't have any parameters, so no danger of sql injection there
17:05:50
kagevf
also, in that document try searching for "$1" to see all the examples where it uses argument placeholders to get more ideas
17:08:34
kagevf
anyway .... try and test it first before thanking me ... I've never used postmodern, but that's how it works with other sql libs
17:10:29
kagevf
to test it, you can try injecting commands to make sure like making body be set to "'some text'); select 'test' --" (maybe get a better example online, but that's the basic idea)