summaryrefslogtreecommitdiff
path: root/test/substitutions_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-08-13 23:52:49 -0600
committerDan Allen <dan.j.allen@gmail.com>2020-08-14 01:59:00 -0600
commit089f2bee5f3a0340882d4beb02e288e749dfd888 (patch)
tree3487a28a672882924b28bb188047857cd0f0d3cd /test/substitutions_test.rb
parent4284a176fac29bdde62288f13e7ebb18defeb9aa (diff)
verify warning is not logged if attribute reference is used in stem macro
Diffstat (limited to 'test/substitutions_test.rb')
-rw-r--r--test/substitutions_test.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/substitutions_test.rb b/test/substitutions_test.rb
index bfd6f51a..3d1e6f62 100644
--- a/test/substitutions_test.rb
+++ b/test/substitutions_test.rb
@@ -1873,9 +1873,12 @@ context 'Substitutions' do
context 'Math macros' do
test 'should passthrough text in asciimath macro and surround with AsciiMath delimiters' do
- input = 'asciimath:[x/x={(1,if x!=0),(text{undefined},if x=0):}]'
- para = block_from_string input
- assert_equal '\$x/x={(1,if x!=0),(text{undefined},if x=0):}\$', para.content
+ using_memory_logger do |logger|
+ input = 'asciimath:[x/x={(1,if x!=0),(text{undefined},if x=0):}]'
+ para = block_from_string input, attributes: { 'attribute-missing' => 'warn' }
+ assert_equal '\$x/x={(1,if x!=0),(text{undefined},if x=0):}\$', para.content
+ assert logger.empty?
+ end
end
test 'should not recognize asciimath macro with no content' do
@@ -2019,9 +2022,12 @@ context 'Substitutions' do
{ 'stem' => 'asciimath' },
{ 'stem' => 'bogus' },
].each do |attributes|
- input = 'stem:[x/x={(1,if x!=0),(text{undefined},if x=0):}]'
- para = block_from_string input, attributes: attributes
- assert_equal '\$x/x={(1,if x!=0),(text{undefined},if x=0):}\$', para.content
+ using_memory_logger do |logger|
+ input = 'stem:[x/x={(1,if x!=0),(text{undefined},if x=0):}]'
+ para = block_from_string input, attributes: (attributes.merge 'attribute-missing' => 'warn')
+ assert_equal '\$x/x={(1,if x!=0),(text{undefined},if x=0):}\$', para.content
+ assert logger.empty?
+ end
end
end