Skip to content

Commit e4b26f9

Browse files
committed
fix test
1 parent a76268e commit e4b26f9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/typhon/compiler.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def step
6363

6464
def num(str)
6565
if str !~ /\A[a@]+\z/
66-
raise ArgumentError, "数値は@とaで指定してください(#{str.inspect})"
66+
raise ProgramError, "数値は@とaで指定してください(#{str.inspect})"
6767
end
6868
num = str.sub(/\Aa/, "+").sub(/\A@/, "-").gsub(/a/, "0").gsub(/@/, "1")
6969
num.to_i(2)

test/test_compiler.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ def test_parseError
142142
end
143143

144144
def test_numError
145-
#NOTE 通らないけどOK
146-
msg = "数値はスペースとタブで指定してください(a@aaa)"
145+
msg = "数値は@とaで指定してください(a@aaa)"
147146
assert_raise_with_message(Typhon::Compiler::ProgramError, msg) do
148147
Typhon::Compiler.compile("aaa@aa@aaa\n")
149148
end

0 commit comments

Comments
 (0)