Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fbe/award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def to_p(any)
when PTerm
any.to_s
when Symbol
s = any.to_s
s = any.to_s.dup
subs = { 0 => '₀', 1 => '₁', 2 => '₂', 3 => '₃', 4 => '₄', 5 => '₅', 6 => '₆', 7 => '₇', 8 => '₈', 9 => '₉' }
s.gsub!(/([a-z]+)([0-9])/) { |_| "#{Regexp.last_match[1]}#{subs[Integer(Regexp.last_match[2], 10)]}" }
"_#{s.tr('_', '-')}_"
Expand Down
10 changes: 10 additions & 0 deletions test/fbe/test_award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ def test_simple
].each { |t| assert_includes(md, t, md) }
end

def test_renders_names_without_chilled_string_warnings
before = Warning[:deprecated]
Warning[:deprecated] = true
assert_output(nil, '') do
Fbe::Award.new('(award (let b1 5) (give b1 "for x"))').bylaw.markdown
end
ensure
Warning[:deprecated] = before
end

def test_let_publishes_the_value_of_an_expression
md = Fbe::Award.new(
'(award (explain "t") (let x (plus 2 3)) (aka (give 1 "for x=${x}") "award ${x} points"))'
Expand Down
Loading