Skip to content

Commit

Permalink
regression test for convert
Browse files Browse the repository at this point in the history
  • Loading branch information
cscheid committed Feb 28, 2024
1 parent f7de219 commit aeaa157
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/docs/convert/backticks.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "d02a6fa3",
"metadata": {},
"outputs": [],
"source": [
"message = \"\"\"\n",
"Content\n",
"```python\n",
"print(\"Hello, world!\")\n",
"```\n",
"\"\"\""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
36 changes: 36 additions & 0 deletions tests/smoke/convert/convert-backticks.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* convert-backticks.test.ts
*
* Copyright (C) 2020-2024 Posit Software, PBC
*
*/
import { existsSync } from "../../../src/deno_ral/fs.ts";
import {
ExecuteOutput,
testQuartoCmd,
} from "../../test.ts";
import { assert } from "testing/asserts.ts";

(() => {
const input = "docs/convert/backticks.ipynb";
testQuartoCmd(
"convert",
["docs/convert/backticks.ipynb"],
[
{
name: "convert-enough-backticks",
verify: async (outputs: ExecuteOutput[]) => {
const txt = Deno.readTextFileSync("docs/convert/backticks.qmd");
assert(txt.includes("````"), "Not enough backticks in output");
}
}
],
{
teardown: async () => {
if (existsSync("docs/convert/backticks.qmd")) {
Deno.removeSync("docs/convert/backticks.qmd");
}
}
},
);
})();

0 comments on commit aeaa157

Please sign in to comment.