-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't fail to parse plans without costs nor analyze
- Loading branch information
Showing
4 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
import { PlanService } from '@/services/plan-service'; | ||
|
||
describe('PlanService', () => { | ||
test('Can`t parse plan with line break from text', () => { | ||
test('Can`t parse plan with line break', () => { | ||
const planService = new PlanService(); | ||
const planText = ` | ||
Seq Scan on ref (cost=0.00..14425.02 rows=1000002 width=8) (actual | ||
`; | ||
expect(() => { planService.fromText(planText); }).toThrow(); | ||
}); | ||
|
||
test('Can`t parse plan with line break', () => { | ||
const planService = new PlanService(); | ||
// tslint:disable:max-line-length | ||
const source = ` | ||
Nested Loop Left Join (cost=11.95..28.52 rows=5 width=157) (actual time=0.010..0.010 rows=0 loops=1) | ||
Output: rel_users_exams.user_username, rel_users_exams.exam_id, rel_users_exams.started_at, rel_users_exams.finished_at, exam_1.id, exam_1.title, ex | ||
here is a line break | ||
Planning Time: 1.110 ms | ||
Execution Time: 0.170 ms`; | ||
expect(() => { planService.fromText(source); }).toThrow(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters