Skip to content

Commit

Permalink
Create output dirs for tests and pretty print JSON to them
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciofierrom committed Aug 9, 2019
1 parent 2fd50c3 commit 67fb593
Show file tree
Hide file tree
Showing 54 changed files with 403 additions and 78 deletions.
2 changes: 2 additions & 0 deletions dialog-flow.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ test-suite dialog-flow-test
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
aeson
, aeson-pretty
, base ^>=4.12.0.0
, bytestring
, containers
, dialogflow
, directory
, hspec
, hspec-discover
default-language: Haskell2010
8 changes: 5 additions & 3 deletions dialog-flow.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ mkDerivation, aeson, base, bytestring, containers, hspec
, hspec-discover, stdenv, text, unordered-containers
{ mkDerivation, aeson, aeson-pretty, base, bytestring, containers
, directory, hspec, hspec-discover, stdenv, text
, unordered-containers
}:
mkDerivation {
pname = "dialogflow";
Expand All @@ -9,7 +10,8 @@ mkDerivation {
aeson base bytestring containers text unordered-containers
];
testHaskellDepends = [
aeson base bytestring containers hspec hspec-discover
aeson aeson-pretty base bytestring containers directory hspec
hspec-discover
];
testToolDepends = [ hspec-discover ];
homepage = "https://github.com/mauriciofierrom/dialogflow";
Expand Down
7 changes: 6 additions & 1 deletion files/message/basic_card_button.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{"open_uri_action":{"uri":"the uri"},"title":"the title"}
{
"open_uri_action": {
"uri": "the uri"
},
"title": "the title"
}
7 changes: 6 additions & 1 deletion files/message/basic_card_image.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{"image":{"image_uri":"the uri","accessibility_text":"the ally text"}}
{
"image": {
"image_uri": "the uri",
"accessibility_text": "the ally text"
}
}
17 changes: 16 additions & 1 deletion files/message/basic_card_with_image.json
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
{"image":{"image_uri":"the uri","accessibility_text":"the ally text"},"buttons":[{"open_uri_action":{"uri":"the uri"},"title":"the title"}],"subtitle":"the subtitle","title":"the title"}
{
"image": {
"image_uri": "the uri",
"accessibility_text": "the ally text"
},
"buttons": [
{
"open_uri_action": {
"uri": "the uri"
},
"title": "the title"
}
],
"subtitle": "the subtitle",
"title": "the title"
}
14 changes: 13 additions & 1 deletion files/message/basic_card_with_text.json
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
{"formatted_text":"the formatted text","buttons":[{"open_uri_action":{"uri":"the uri"},"title":"the title"}],"subtitle":"the subtitle","title":"the title"}
{
"formatted_text": "the formatted text",
"buttons": [
{
"open_uri_action": {
"uri": "the uri"
},
"title": "the title"
}
],
"subtitle": "the subtitle",
"title": "the title"
}
5 changes: 4 additions & 1 deletion files/message/card_button.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"text":"the text","postback":"the postback"}
{
"text": "the text",
"postback": "the postback"
}
14 changes: 13 additions & 1 deletion files/message/card_image.json
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
{"card":{"buttons":[{"text":"the text","postback":"the postback"}],"image_uri":"the uri","subtitle":"the subtitle","title":"the title"}}
{
"card": {
"buttons": [
{
"text": "the text",
"postback": "the postback"
}
],
"image_uri": "the uri",
"subtitle": "the subtitle",
"title": "the title"
}
}
19 changes: 18 additions & 1 deletion files/message/carousel_select.json
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
{"items":[{"image":{"image_uri":"the uri","accessibility_text":"the ally text"},"title":"the title","description":"the description","info":{"key":"the key","synonyms":["a synonym"]}}]}
{
"items": [
{
"image": {
"image_uri": "the uri",
"accessibility_text": "the ally text"
},
"title": "the title",
"description": "the description",
"info": {
"key": "the key",
"synonyms": [
"a synonym"
]
}
}
]
}
5 changes: 4 additions & 1 deletion files/message/image.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"image_uri":"the uri","accessibility_text":"the ally text"}
{
"image_uri": "the uri",
"accessibility_text": "the ally text"
}
15 changes: 14 additions & 1 deletion files/message/item.json
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{"image":{"image_uri":"the uri","accessibility_text":"the ally text"},"title":"the title","description":"the description","info":{"key":"the key","synonyms":["a synonym"]}}
{
"image": {
"image_uri": "the uri",
"accessibility_text": "the ally text"
},
"title": "the title",
"description": "the description",
"info": {
"key": "the key",
"synonyms": [
"a synonym"
]
}
}
5 changes: 4 additions & 1 deletion files/message/link_out_suggestion.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"destination_name":"the name","uri":"the app"}
{
"destination_name": "the name",
"uri": "the app"
}
20 changes: 19 additions & 1 deletion files/message/list_select.json
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
{"items":[{"image":{"image_uri":"the uri","accessibility_text":"the ally text"},"title":"the title","description":"the description","info":{"key":"the key","synonyms":["a synonym"]}}],"title":"the title"}
{
"items": [
{
"image": {
"image_uri": "the uri",
"accessibility_text": "the ally text"
},
"title": "the title",
"description": "the description",
"info": {
"key": "the key",
"synonyms": [
"a synonym"
]
}
}
],
"title": "the title"
}
4 changes: 3 additions & 1 deletion files/message/open_uri_action.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"uri":"the uri"}
{
"uri": "the uri"
}
7 changes: 6 additions & 1 deletion files/message/quick_replies.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{"title":"the title","quick_replies":["the reply"]}
{
"title": "the title",
"quick_replies": [
"the reply"
]
}
7 changes: 6 additions & 1 deletion files/message/selected_item_info.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{"key":"the key","synonyms":["a synonym"]}
{
"key": "the key",
"synonyms": [
"a synonym"
]
}
5 changes: 4 additions & 1 deletion files/message/simple_response_ssml.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"displayText":"the maybe text","ssml":"the xml"}
{
"displayText": "the maybe text",
"ssml": "the xml"
}
5 changes: 4 additions & 1 deletion files/message/simple_response_text.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"displayText":"the maybe text","textToSpeech":"the text"}
{
"displayText": "the maybe text",
"textToSpeech": "the text"
}
11 changes: 10 additions & 1 deletion files/message/simple_responses.json
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
{"simpleResponses":{"simpleResponses":[{"displayText":"the display text","textToSpeech":"the text"}]}}
{
"simpleResponses": {
"simpleResponses": [
{
"displayText": "the display text",
"textToSpeech": "the text"
}
]
}
}
4 changes: 3 additions & 1 deletion files/message/ssml.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"ssml":"the xml"}
{
"ssml": "the xml"
}
4 changes: 3 additions & 1 deletion files/message/suggestion.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"title":"the title"}
{
"title": "the title"
}
8 changes: 7 additions & 1 deletion files/message/suggestions.json
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
{"suggestions":[{"title":"the suggestion"}]}
{
"suggestions": [
{
"title": "the suggestion"
}
]
}
6 changes: 5 additions & 1 deletion files/message/text.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{"text":["the text"]}
{
"text": [
"the text"
]
}
4 changes: 3 additions & 1 deletion files/message/text_to_speech.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"textToSpeech":"the text"}
{
"textToSpeech": "the text"
}
10 changes: 9 additions & 1 deletion files/payload/google/android_app.json
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
{"packageName":"the package name","versions":[{"minVersion":1,"maxVersion":2}]}
{
"packageName": "the package name",
"versions": [
{
"minVersion": 1,
"maxVersion": 2
}
]
}
15 changes: 14 additions & 1 deletion files/payload/google/basic_card.json
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{"basicCard":{"image":{"height":300,"url":"the url","accessibilityText":"the ally text","width":700},"buttons":[],"subtitle":"the subtitle","imageDisplayOptions":"DEFAULT","title":"the title"}}
{
"basicCard": {
"image": {
"height": 300,
"url": "the url",
"accessibilityText": "the ally text",
"width": 700
},
"buttons": [],
"subtitle": "the subtitle",
"imageDisplayOptions": "DEFAULT",
"title": "the title"
}
}
4 changes: 3 additions & 1 deletion files/payload/google/basic_card_formatted_text.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"formattedText":"the formatted text"}
{
"formattedText": "the formatted text"
}
9 changes: 8 additions & 1 deletion files/payload/google/basic_card_image.json
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
{"image":{"height":300,"url":"the url","accessibilityText":"the ally text","width":700}}
{
"image": {
"height": 300,
"url": "the url",
"accessibilityText": "the ally text",
"width": 700
}
}
7 changes: 6 additions & 1 deletion files/payload/google/image.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{"height":300,"url":"the url","accessibilityText":"the ally text","width":700}
{
"height": 300,
"url": "the url",
"accessibilityText": "the ally text",
"width": 700
}
4 changes: 3 additions & 1 deletion files/payload/google/image_display_option_cropped.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"imageDisplayOptions":"CROPPED"}
{
"imageDisplayOptions": "CROPPED"
}
4 changes: 3 additions & 1 deletion files/payload/google/image_display_option_default.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"imageDisplayOptions":"DEFAULT"}
{
"imageDisplayOptions": "DEFAULT"
}
4 changes: 3 additions & 1 deletion files/payload/google/image_display_option_white.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"imageDisplayOptions":"WHITE"}
{
"imageDisplayOptions": "WHITE"
}
17 changes: 0 additions & 17 deletions files/payload/google/link_out_suggestion.json

This file was deleted.

Loading

0 comments on commit 67fb593

Please sign in to comment.