mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add testcase for #1860
This commit is contained in:
parent
c6c9c5c264
commit
23eb0e24fc
@ -29,6 +29,7 @@ try:
|
||||
except ImportError:
|
||||
native_module = False
|
||||
|
||||
from sphinx.errors import SphinxError
|
||||
from sphinx.search import SearchLanguage
|
||||
|
||||
|
||||
@ -49,10 +50,14 @@ class MecabBinder(object):
|
||||
else:
|
||||
result = self.ctypes_libmecab.mecab_sparse_tostr(
|
||||
self.ctypes_mecab, input.encode(self.dict_encode))
|
||||
if result is None:
|
||||
raise SphinxError('Failed to tokenize text:\nMecab: %s\nInput:\n%s' %
|
||||
(self.ctypes_mecab, input))
|
||||
if PY3:
|
||||
return result.split(' ')
|
||||
else:
|
||||
return result.decode(self.dict_encode).split(' ')
|
||||
return result.decode(self.dict_encode).split(' ')
|
||||
|
||||
def init_native(self, options):
|
||||
param = '-Owakati'
|
||||
|
22
tests/test_build_manpage.py
Normal file
22
tests/test_build_manpage.py
Normal file
@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
test_build_manpage
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Test the build process with manpage builder with the test root.
|
||||
|
||||
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
from util import with_app
|
||||
|
||||
|
||||
@with_app(buildername='man')
|
||||
def test_all(app, status, warning):
|
||||
app.builder.build_all()
|
||||
assert (app.outdir / 'SphinxTests.1').exists()
|
||||
|
||||
content = (app.outdir / 'SphinxTests.1').text()
|
||||
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
|
Loading…
Reference in New Issue
Block a user