librustdoc: Fix a bunch of rustdoc tests. rs=bustage
This commit is contained in:
parent
5245aceba9
commit
47cd1e4fc8
19 changed files with 113 additions and 0 deletions
|
@ -21,6 +21,7 @@ use parse;
|
||||||
use util;
|
use util;
|
||||||
|
|
||||||
use core::oldcomm;
|
use core::oldcomm;
|
||||||
|
use core::vec;
|
||||||
use rustc::back::link;
|
use rustc::back::link;
|
||||||
use rustc::driver::driver;
|
use rustc::driver::driver;
|
||||||
use rustc::driver::session::Session;
|
use rustc::driver::session::Session;
|
||||||
|
|
|
@ -31,6 +31,9 @@ pub type CrateAttrs = {
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use syntax::ast;
|
||||||
|
use syntax;
|
||||||
|
|
||||||
fn parse_attributes(+source: ~str) -> ~[ast::attribute] {
|
fn parse_attributes(+source: ~str) -> ~[ast::attribute] {
|
||||||
use syntax::parse;
|
use syntax::parse;
|
||||||
use syntax::parse::parser;
|
use syntax::parse::parser;
|
||||||
|
|
|
@ -310,6 +310,11 @@ fn should_extract_impl_method_docs() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
|
||||||
fn mk_doc(source: ~str) -> doc::Doc {
|
fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv, ~"");
|
let doc = extract::from_srv(srv, ~"");
|
||||||
|
|
|
@ -100,6 +100,12 @@ fn should_promote_impl_method_desc() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use attr_pass;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
|
||||||
fn mk_doc(source: ~str) -> doc::Doc {
|
fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv, ~"");
|
let doc = extract::from_srv(srv, ~"");
|
||||||
|
|
|
@ -344,6 +344,12 @@ fn should_extract_struct_fields() {
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use doc;
|
||||||
|
use parse;
|
||||||
|
|
||||||
|
use core::vec;
|
||||||
|
|
||||||
fn mk_doc(+source: ~str) -> doc::Doc {
|
fn mk_doc(+source: ~str) -> doc::Doc {
|
||||||
let ast = parse::from_str(source);
|
let ast = parse::from_str(source);
|
||||||
extract(ast, ~"")
|
extract(ast, ~"")
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
use doc;
|
use doc;
|
||||||
|
use extract;
|
||||||
|
use parse;
|
||||||
|
|
||||||
use core::vec;
|
use core::vec;
|
||||||
use std::par;
|
use std::par;
|
||||||
|
|
|
@ -252,6 +252,15 @@ fn should_index_foreign_mod_contents() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use attr_pass;
|
||||||
|
use config;
|
||||||
|
use desc_to_brief_pass;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
use path_pass;
|
||||||
|
|
||||||
fn mk_doc(output_style: config::OutputStyle, +source: ~str) -> doc::Doc {
|
fn mk_doc(output_style: config::OutputStyle, +source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let config = {
|
let config = {
|
||||||
|
|
|
@ -11,15 +11,28 @@
|
||||||
//! Generate markdown from a document tree
|
//! Generate markdown from a document tree
|
||||||
|
|
||||||
use astsrv;
|
use astsrv;
|
||||||
|
use attr_pass;
|
||||||
|
use config;
|
||||||
|
use desc_to_brief_pass;
|
||||||
use doc::ItemUtils;
|
use doc::ItemUtils;
|
||||||
use doc;
|
use doc;
|
||||||
|
use extract;
|
||||||
use fold;
|
use fold;
|
||||||
|
use markdown_index_pass;
|
||||||
use markdown_pass;
|
use markdown_pass;
|
||||||
use markdown_writer::Writer;
|
use markdown_writer::Writer;
|
||||||
use markdown_writer::WriterUtils;
|
use markdown_writer::WriterUtils;
|
||||||
use markdown_writer::WriterFactory;
|
use markdown_writer::WriterFactory;
|
||||||
|
use markdown_writer;
|
||||||
|
use page_pass;
|
||||||
|
use path_pass;
|
||||||
|
use sectionalize_pass;
|
||||||
use sort_pass;
|
use sort_pass;
|
||||||
|
use trim_pass;
|
||||||
|
use unindent_pass;
|
||||||
|
|
||||||
|
use core::iter;
|
||||||
|
use core::oldcomm;
|
||||||
use core::str;
|
use core::str;
|
||||||
use core::vec;
|
use core::vec;
|
||||||
use std::par;
|
use std::par;
|
||||||
|
@ -817,6 +830,24 @@ fn should_write_struct_header() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use attr_pass;
|
||||||
|
use config;
|
||||||
|
use desc_to_brief_pass;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
use markdown_index_pass;
|
||||||
|
use markdown_writer;
|
||||||
|
use path_pass;
|
||||||
|
use sectionalize_pass;
|
||||||
|
use trim_pass;
|
||||||
|
use tystr_pass;
|
||||||
|
use unindent_pass;
|
||||||
|
|
||||||
|
use core::oldcomm;
|
||||||
|
use core::str;
|
||||||
|
|
||||||
fn render(+source: ~str) -> ~str {
|
fn render(+source: ~str) -> ~str {
|
||||||
let (srv, doc) = create_doc_srv(source);
|
let (srv, doc) = create_doc_srv(source);
|
||||||
let markdown = write_markdown_str_srv(srv, doc);
|
let markdown = write_markdown_str_srv(srv, doc);
|
||||||
|
|
|
@ -267,6 +267,12 @@ fn should_name_mod_file_names_by_path() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
use path_pass;
|
||||||
|
|
||||||
fn mk_doc(+name: ~str, +source: ~str) -> doc::Doc {
|
fn mk_doc(+name: ~str, +source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv, name);
|
let doc = extract::from_srv(srv, name);
|
||||||
|
|
|
@ -183,6 +183,12 @@ fn should_remove_foreign_mods_from_containing_mods() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use config;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
|
||||||
fn mk_doc_(
|
fn mk_doc_(
|
||||||
output_style: config::OutputStyle,
|
output_style: config::OutputStyle,
|
||||||
source: ~str
|
source: ~str
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
use astsrv;
|
use astsrv;
|
||||||
use doc;
|
use doc;
|
||||||
|
use extract;
|
||||||
|
|
||||||
use core::vec;
|
use core::vec;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
use astsrv;
|
use astsrv;
|
||||||
use doc::ItemUtils;
|
use doc::ItemUtils;
|
||||||
use doc;
|
use doc;
|
||||||
|
use extract;
|
||||||
use fold::Fold;
|
use fold::Fold;
|
||||||
use fold;
|
use fold;
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,11 @@ fn should_prune_hidden_items() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
|
||||||
fn mk_doc(source: ~str) -> doc::Doc {
|
fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv, ~"");
|
let doc = extract::from_srv(srv, ~"");
|
||||||
|
|
|
@ -18,6 +18,7 @@ use fold::Fold;
|
||||||
use fold;
|
use fold;
|
||||||
|
|
||||||
use core::util;
|
use core::util;
|
||||||
|
use core::vec;
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
|
|
||||||
export mk_pass;
|
export mk_pass;
|
||||||
|
@ -75,6 +76,10 @@ fn should_prune_items_without_pub_modifier() {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
|
use astsrv;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
|
||||||
pub fn mk_doc(source: ~str) -> doc::Doc {
|
pub fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv, ~"");
|
let doc = extract::from_srv(srv, ~"");
|
||||||
|
|
|
@ -11,12 +11,15 @@
|
||||||
//! Breaks rustdocs into sections according to their headers
|
//! Breaks rustdocs into sections according to their headers
|
||||||
|
|
||||||
use astsrv;
|
use astsrv;
|
||||||
|
use attr_pass;
|
||||||
use doc::ItemUtils;
|
use doc::ItemUtils;
|
||||||
use doc;
|
use doc;
|
||||||
|
use extract;
|
||||||
use fold::Fold;
|
use fold::Fold;
|
||||||
use fold;
|
use fold;
|
||||||
|
|
||||||
use core::str;
|
use core::str;
|
||||||
|
use core::vec;
|
||||||
use std::par;
|
use std::par;
|
||||||
|
|
||||||
pub fn mk_pass() -> Pass {
|
pub fn mk_pass() -> Pass {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
use astsrv;
|
use astsrv;
|
||||||
use doc::ItemUtils;
|
use doc::ItemUtils;
|
||||||
use doc;
|
use doc;
|
||||||
|
use extract;
|
||||||
use fold::Fold;
|
use fold::Fold;
|
||||||
use fold;
|
use fold;
|
||||||
use util::NominalOp;
|
use util::NominalOp;
|
||||||
|
|
|
@ -289,6 +289,16 @@ fn should_execute_on_impl_method_section_bodies() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use attr_pass;
|
||||||
|
use desc_to_brief_pass;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
use sectionalize_pass;
|
||||||
|
|
||||||
|
use core::str;
|
||||||
|
|
||||||
fn mk_doc(source: ~str) -> doc::Doc {
|
fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv, ~"");
|
let doc = extract::from_srv(srv, ~"");
|
||||||
|
|
|
@ -36,6 +36,12 @@ fn should_trim_text() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astrsrv;
|
||||||
|
use attr_pass;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
|
||||||
fn mk_doc(source: ~str) -> doc::Doc {
|
fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv, ~"");
|
let doc = extract::from_srv(srv, ~"");
|
||||||
|
|
|
@ -407,6 +407,11 @@ fn should_not_serialize_struct_attrs() {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
|
|
||||||
|
use astsrv;
|
||||||
|
use doc;
|
||||||
|
use extract;
|
||||||
|
|
||||||
fn mk_doc(source: ~str) -> doc::Doc {
|
fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv, ~"");
|
let doc = extract::from_srv(srv, ~"");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue