import Foundation import Testing @testable import OrgCore /// reveal.js export against the structure org-re-reveal writes; Emacs's org-re-reveal isn't /// installed for an oracle test. struct RevealExportTests { static let library = URL(fileURLWithPath: #filePath).deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent() .appendingPathComponent("Sources/OrgMathJax/Reveal") static let deck = """ #+TITLE: Talk #+AUTHOR: Ann #+DATE: 2026-11-26 #+OPTIONS: toc:nil num:nil * First Intro text. #+BEGIN_NOTES Say hello. #+END_NOTES ** Down #+ATTR_REVEAL: :frag (appear) - one - two * Second #+ATTR_REVEAL: :frag fade-in :frag_idx 2 A fragment. *** Deep Still on Second's group. """ /// The slides alone, between the slides div and its end, without the title slide. static func slides(_ html: String) -> String { let start = html.range(of: "
\n")!.upperBound let end = html.range(of: "
\n\n", options: .backwards)!.lowerBound return String(html[start..

Talk

Ann

2026-11-26

First

Intro text.

Down

  • one
  • two

Second

A fragment.

Deep

Still on Second's group.

""") } @Test func inlinesRevealWithoutRoot() throws { let html = RevealExport.document(Self.deck, fallbackTitle: "talk", library: Self.library) let theme = try String(contentsOf: Self.library.appendingPathComponent("theme/black.css"), encoding: .utf8) let script = try String(contentsOf: Self.library.appendingPathComponent("reveal.js"), encoding: .utf8) #expect(html.contains("")) #expect(html.contains("")) #expect(!html.contains("\n\n")) #expect(html.contains("controls: false,")) #expect(html.contains("transition: 'fade',\ntransitionSpeed: 'default',\nwidth:1200, height:800,\nslideNumber:false,\nplugins: [ RevealNotes, RevealHighlight ]")) #expect(!html.contains("