Skip to content

Commit 9a8a38f

Browse files
committed
Drop full site integration test; add empty lines
1 parent bfa081f commit 9a8a38f

File tree

6 files changed

+10
-28
lines changed

6 files changed

+10
-28
lines changed

R/build-llm.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ build_llm_docs <- function(pkg = ".") {
4343

4444
index <- c(
4545
read_lines(path(pkg$dst_path, "index.md")),
46+
"",
4647
read_file_if_exists(path(pkg$dst_path, "reference", "index.md")),
48+
"",
4749
read_file_if_exists(path(pkg$dst_path, "articles", "index.md"))
4850
)
4951
write_lines(index, path(pkg$dst_path, "llms.txt"))

tests/testthat/_snaps/build-llm.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# integration test for convert_md()
2+
3+
Code
4+
readLines(path)
5+
Output
6+
[1] "# Page title" "" "## Heading" "" "Some text"
7+

tests/testthat/_snaps/build-llm/index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/testthat/_snaps/build-llm/llm.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/testthat/_snaps/build-llm/llms.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/testthat/test-build-llm.R

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
1-
test_that("integration test for build_llm_docs()", {
2-
skip_if_no_pandoc()
3-
pkg <- local_pkgdown_site(
4-
desc = list(
5-
Package = "pkgdown",
6-
Description = "My package does great things!"
7-
),
8-
meta = list(url = "https://pkgdown.r-lib.org")
9-
)
10-
11-
suppressMessages(build_site(pkg, devel = TRUE))
12-
13-
llms_txt <- path(pkg$dst_path, "llms.txt")
14-
expect_snapshot_file(llms_txt)
15-
16-
index_md <- path(pkg$dst_path, "index.md")
17-
expect_snapshot_file(index_md)
18-
})
19-
201
test_that("integration test for convert_md()", {
212
skip_if_no_pandoc()
223

234
path <- withr::local_tempfile(pattern = "pkgdown-llm")
245
convert_md(test_path("assets", "llm.html"), path)
25-
expect_snapshot_file(path, name = "llm.md")
6+
expect_snapshot(readLines(path))
267
})
278

289
test_that("simplifies page header", {

0 commit comments

Comments
 (0)