Skip to content

Commit

Permalink
Added test for single quote without a space.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav committed Dec 6, 2023
1 parent 5e89aa0 commit af8a890
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/formats-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ tape("Handle Newick strings with spaces", function(test) {
* can read and write Newick strings correctly.
*/

let nwk = "('Alpha beta', ('Alpha gamma', ('Delta''s epsilon', 'Epsilon zeta ''alphonso''')))";
let nwk = "('Alpha beta', ('Alpha gamma', ('Delta''s epsilon', 'Epsilon zeta ''alphonso''', 'test''')))";
let phylo = new phylotree.phylotree(nwk);

let test_leaves = ['Alpha beta', 'Alpha gamma', "Delta's epsilon", "Epsilon zeta 'alphonso'"];
let test_leaves = ['Alpha beta', 'Alpha gamma', "Delta's epsilon", "Epsilon zeta 'alphonso'", "test'"];
test_leaves.forEach(function(leaf) {
let node = phylo.getNodeByName(leaf);
test.equal(node.data.name, leaf);
Expand All @@ -94,7 +94,7 @@ tape("Handle Newick strings with spaces", function(test) {
// This would be identical to the original Newick string, but phylotree.js coerces
// lengths to 1 (see https://github.com/veg/phylotree.js/issues/440). So we expect
// all lengths to be set to 1 on export.
test.equal(phylo.getNewick(), "('Alpha beta':1,('Alpha gamma':1,('Delta''s epsilon':1,'Epsilon zeta ''alphonso''':1):1):1):1;");
test.equal(phylo.getNewick(), "('Alpha beta':1,('Alpha gamma':1,('Delta''s epsilon':1,'Epsilon zeta ''alphonso''':1,'test''':1):1):1):1;");

test.end();
});

0 comments on commit af8a890

Please sign in to comment.