Skip to content

Commit

Permalink
Deleted redundant test
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbra committed Aug 13, 2023
1 parent 4c8c400 commit aaafdfc
Showing 1 changed file with 1 addition and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ FROM information_schema.schemata
public void Splits_on_semicolon_after_single_quotes_when_there_is_another_semicolon_in_the_quote()
{
var original = @"SELECT 1 WHERE whatnot = '; ' ; MOO";
var batches = Splitter.Split(original);
var batches = Splitter.Split(original).ToList();
batches.Should().HaveCount(2);

batches.First().Should().Be("SELECT 1 WHERE whatnot = '; ' ");
Expand All @@ -102,42 +102,4 @@ public void Ignores_semicolon_in_single_quotes_when_there_is_no_other_semicolon(
batches.Should().HaveCount(1);
}

[Test]
public void Ignores_semicolon_in_strings_with_directly_appended_operator()
{
var original = @"
CREATE VIEW wgs.wgs_pages_branches AS
SELECT branches.instrumentid,
branches.plabel AS from_plabel,
CASE
WHEN (NOT (branches.branch ~~* '%?%'::text)) THEN ""substring""(branches.branch, (""position""(branches.branch, '->'::text) + 3), length(branches.branch))
ELSE NULL::text
END AS to_plabel,
CASE
WHEN (branches.branch ~~* '?%'::text) THEN branches.branch
WHEN (branches.branch ~~* '%?%'::text) THEN ""substring""(branches.branch, (""position""(branches.branch, '->'::text) + 2), length(branches.branch))
ELSE NULL::text
END AS to_other,
branches.rank AS condition_rank,
CASE
WHEN (""substring""(branches.branch, 0, ""position""(branches.branch, '->'::text)) ~~* 'ELSE'::text) THEN 'TRUE'::text
ELSE ""substring""(branches.branch, 0, ""position""(branches.branch, '->'::text))
END AS condition
FROM ( SELECT foo.instrumentid,
foo.plabel,
foo.branch,
row_number() OVER (PARTITION BY foo.instrumentid, foo.plabel ORDER BY foo.rankgroup) AS rank
FROM ( SELECT wgs_pages.instrumentid,
wgs_pages.plabel,
unnest(string_to_array(wgs_pages.nextbranch, ';'::text)) AS branch,
row_number() OVER (ORDER BY wgs_pages.instrumentid, wgs_pages.plabel) AS rankgroup
FROM wgs.wgs_pages) foo) branches;
";

var batches = Splitter.Split(original);
batches.Should().HaveCount(1);

}


}

0 comments on commit aaafdfc

Please sign in to comment.