Skip to content

Commit

Permalink
Merge pull request #188 from metafacture/160-integrationTestsForCondi…
Browse files Browse the repository at this point in the history
…tionals

Add simple integration tests for conditionals  and for #187
  • Loading branch information
TobiasNx authored Mar 3, 2022
2 parents a957e85 + 5873311 commit 02652c9
Show file tree
Hide file tree
Showing 104 changed files with 947 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : "dog"
}
{
"type" : "video"
}
{
"type" : "book",
"test" : "test"
}
{
"type" : "stone"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : "dog"
}
{
"type" : "video"
}
{
"type" : "book"
}
{
"type" : "stone"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if any_equal("type", "book")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type" : [ "dog", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "video", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "book", "pc" ]
}
{
"type" : [ "human", "cat" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type" : [ "dog", "dog", "dog" ]
}
{
"type" : [ "video", "dog", "dog" ]
}
{
"type" : [ "book", "pc" ]
}
{
"type" : [ "human", "cat" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if all_contain("type[]", "o")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type" : "dog"
}
{
"type" : "video",
"test" : "test"
}
{
"type" : "book"
}
{
"type" : "stone",
"test" : "test"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type" : "dog"
}
{
"type" : "video"
}
{
"type" : "book"
}
{
"type" : "stone"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if all_contain("type", "e")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : [ "dog", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "video", "dog", "dog" ]
}
{
"type" : [ "book", "dog", "dog" ]
}
{
"type" : [ "stone", "cat" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : [ "dog", "dog", "dog" ]
}
{
"type" : [ "video", "dog", "dog" ]
}
{
"type" : [ "book", "dog", "dog" ]
}
{
"type" : [ "stone", "cat" ]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if all_equal("type[]", "dog")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : "dog"
}
{
"type" : "video"
}
{
"type" : "book",
"test" : "test"
}
{
"type" : "stone"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : "dog"
}
{
"type" : "video"
}
{
"type" : "book"
}
{
"type" : "stone"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if all_equal("type", "book")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : [ "dog", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "video", "dog", "dog" ]
}
{
"type" : [ "book", "pc" ]
}
{
"type" : [ "stone", "cat" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type" : [ "dog", "dog", "dog" ]
}
{
"type" : [ "video", "dog", "dog" ]
}
{
"type" : [ "book", "pc" ]
}
{
"type" : [ "stone", "cat" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if all_match("type[]", "\\S{3}")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type" : "dog"
}
{
"type" : "video",
"test" : "test"
}
{
"type" : "book"
}
{
"type" : "stone",
"test" : "test"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : "dog"
}
{
"type" : "video"
}
{
"type" : "book"
}
{
"type" : "stone"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if all_match("type", "\\S{5}")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type" : [ "dog", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "video", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "book", "pc" ],
"test" : "test"
}
{
"type" : [ "human", "cat" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type" : [ "dog", "dog", "dog" ]
}
{
"type" : [ "video", "dog", "dog" ]
}
{
"type" : [ "book", "pc" ]
}
{
"type" : [ "human", "cat" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if any_contain("type[]", "o")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type" : "dog"
}
{
"type" : "video",
"test" : "test"
}
{
"type" : "book"
}
{
"type" : "stone",
"test" : "test"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type" : "dog"
}
{
"type" : "video"
}
{
"type" : "book"
}
{
"type" : "stone"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if any_contain("type", "e")
add_field("test", "test")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type" : [ "dog", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "video", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "book", "dog", "dog" ],
"test" : "test"
}
{
"type" : [ "stone", "cat" ]
}
Loading

0 comments on commit 02652c9

Please sign in to comment.