expr-csv-story Pub

CSV tests

No headers

send::  msg ctx.set  (csv="1,2,3,4,5 6,7,8,9,10")

send::  msg ctx.csvToJson  (payload, separator=",", hasHeaders:Boolean)

expect::  (payload is Array)
expect::  (payload[="0"=0] is Json)

With Headers

send::  msg ctx.set  (csv ="h1,h2,h3,h4,h51,2,3,4,56,7,8,9"...)

send::  msg ctx.csvToJson  (payload, separator=",", hasHeaders:Boolean)

expect::  (payload is Array)
expect::  (payload[="0"=0] is Json)

expect::  (payload[="1"=1][:String="h2"] is 7)


Was this useful?    

By: Razie | 2023-08-11 | Tags: story , dsl


Viewed 169 times ( | History | Print ) this page.

You need to log in to post a comment!

© Copyright DieselApps, 2012-2024, all rights reserved.