mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 21:19:01 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			724 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			724 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
const handleParens = require('../../src/services/search/services/handle_parens.js');
 | 
						|
 | 
						|
describe("Parens handler", () => {
 | 
						|
    it("handles parens", () => {
 | 
						|
        const input = ["(", "hello", ")", "and", "(", "(", "pick", "one", ")", "and", "another", ")"]
 | 
						|
            .map(token => ({token}));
 | 
						|
 | 
						|
        expect(handleParens(input))
 | 
						|
            .toEqual([
 | 
						|
                [
 | 
						|
                    {token: "hello"}
 | 
						|
                ],
 | 
						|
                {token: "and"},
 | 
						|
                [
 | 
						|
                    [
 | 
						|
                        {token: "pick"},
 | 
						|
                        {token: "one"}
 | 
						|
                    ],
 | 
						|
                    {token: "and"},
 | 
						|
                    {token: "another"}
 | 
						|
                ]
 | 
						|
            ]);
 | 
						|
    });
 | 
						|
});
 |