@@ -12,12 +12,14 @@ if (rmarkdown::pandoc_available("1.12.3")) {
1212 )
1313 })
1414 lines <- readLines(file.path(dirname(res ), " section-issue.html" ))
15- one_line_exists <- grep(' <h2><span class="header-section-number">1.2</span> Issue: #1</h2>' ,
16- lines , fixed = TRUE )
17- sub_commit_1 <- grep(' <h3><span class="header-section-number">1.2.1</span> commit: example: modification</h3>' ,
18- lines , fixed = TRUE )
19- sub_commit_2 <- grep(' <h3><span class="header-section-number">1.2.2</span> commit: Add NEWS</h3>' ,
20- lines , fixed = TRUE )
15+ # like <h2><span>1.2</span> Issue: #1</h2>',
16+ one_line_exists <- grep(' h2.+1[.]2.+Issue: #1.+h2' , lines , fixed = FALSE )
17+ # like <h3><span>1.2.1</span> commit: example: modification</h3>',
18+ sub_commit_1 <- grep(' h3.+1[.]2[.]1.+commit: example: modification.+h3' ,
19+ lines , fixed = FALSE )
20+ # like <h3><span>1.2.2</span> commit: Add NEWS</h3>',
21+ sub_commit_2 <- grep(' h3.+1[.]2[.]2.+commit: Add NEWS.+h3' ,
22+ lines , fixed = FALSE )
2123
2224 test_that(" git_down function" ,{
2325 expect_match(res , regexp = " .html" )
@@ -39,8 +41,9 @@ if (rmarkdown::pandoc_available("1.12.3")) {
3941 })
4042
4143 lines <- readLines(file.path(dirname(res ), " section-digit.html" ))
42- one_line_exists <- grep(' <h2><span class="header-section-number">1.2</span> <code>#--:digit:--+</code>: #1</h2>' ,
43- lines , fixed = TRUE )
44+ # like <h2><span>1.2</span> <code>#--:digit:--+</code>: #1</h2>',
45+ one_line_exists <- grep(' h2.+1[.]2.+<code>#--:digit:--\\ +</code>: #1.+h2' ,
46+ lines , fixed = FALSE )
4447
4548 test_that(" git_down no name function" ,{
4649 expect_match(res , regexp = " .html" )
@@ -69,14 +72,16 @@ if (rmarkdown::pandoc_available("1.12.3")) {
6972 expect_true(file.exists(tickets_file ))
7073
7174 lines <- readLines(tickets_file )
72- one_line_ticket_exists <- grep(' <h2><span class="header-section-number">1.2</span> Ticket: ticket1234</h2>' ,
73- lines , fixed = TRUE )
75+ # like <h2><span>1.2</span> Ticket: ticket1234</h2>'
76+ one_line_ticket_exists <- grep(' h2.*1.2.*Ticket: ticket1234.*h2' ,
77+ lines , fixed = FALSE )
7478
7579 expect_true(length(one_line_ticket_exists ) == 1 )
7680
7781 lines <- readLines(issues_file )
78- one_line_exists <- grep(' <h2><span class="header-section-number">2.2</span> Issue: #1</h2>' ,
79- lines , fixed = TRUE )
82+ # like <h2><span>2.2</span> Issue: #1</h2>',
83+ one_line_exists <- grep(' h2.+2[.]2.+Issue: #1.+h2' ,
84+ lines , fixed = FALSE )
8085 expect_true(length(one_line_exists ) == 1 )
8186 })
8287
0 commit comments