Skip to content

Commit

Permalink
nqp::xxx -> nqp:xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed Oct 16, 2013
1 parent 49838b9 commit 3a3ae17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
7 changes: 4 additions & 3 deletions examples/rubyish/t/00hello-worldish.t
100644 → 100755
@@ -1,6 +1,7 @@
puts "1..4"

def capitalize(s)
nqp::uc(nqp::substr(s, 0, 1)) ~ nqp::lc(nqp::substr(s, 1));
nqp:uc(nqp:substr(s, 0, 1)) ~ nqp:lc(nqp:substr(s, 1));
end

class HelloWorld
Expand All @@ -14,7 +15,7 @@ class HelloWorld
end

hello = HelloWorld.new("worldish")
puts "#{nqp::can(hello, 'sayHi')? 'ok' : 'nok'} 2 - can say Hi"
puts "#{nqp::can(hello, 'sayBye')? 'nok' : 'ok'} 3 - can't say Bye"
puts "#{nqp:can(hello, 'sayHi')? 'ok' : 'nok'} 2 - can say Hi"
puts "#{nqp:can(hello, 'sayBye')? 'nok' : 'ok'} 3 - can't say Bye"
hello.sayHi

24 changes: 12 additions & 12 deletions examples/rubyish/t/nqp-ops.t
100644 → 100755
@@ -1,24 +1,24 @@
puts "1..11"
nqp::say("ok 1 - nqp::say")
nqp::print("ok 2 - nqp::print with new-line\n")
puts nqp::concat("ok ", '3 - nqp::concat')
puts nqp::substr("nok 4 - nqp::substr", 1)
puts nqp::lc("OK 5 - nQp::lC")
nqp::print nqp::chr(nqp::ord('o')); puts 'k 6 - nqp::ord and nqp::chr'
nqp:say("ok 1 - nqp:say")
nqp:print("ok 2 - nqp:print with new-line\n")
puts nqp:concat("ok ", '3 - nqp:concat')
puts nqp:substr("nok 4 - nqp:substr", 1)
puts nqp:lc("OK 5 - nqp:lC")
nqp:print nqp:chr(nqp:ord('o')); puts 'k 6 - nqp:ord and nqp:chr'

def ok(i,msg)
nqp::say("ok #{i} - #{msg}");
nqp:say("ok #{i} - #{msg}");
end
def nok(i,msg)
nqp::say("nok #{i} - #{msg}");
nqp:say("nok #{i} - #{msg}");
end

nqp::if(2+2 == 4, ok(7, "nqp::if (true)"), nok(7, "nqp::if (true)"))
nqp::if(2+2 == 5, nok(8, "nqp::if (true)"), ok(8, "nqp::if (false)"))
nqp:if(2+2 == 4, ok(7, "nqp:if (true)"), nok(7, "nqp:if (true)"))
nqp:if(2+2 == 5, nok(8, "nqp:if (true)"), ok(8, "nqp:if (false)"))

n = 9

nqp::while n <= 11, begin
ok(n, "nqp::while (#{n})")
nqp:while n <= 11, begin
ok(n, "nqp:while (#{n})")
n += 1
end

0 comments on commit 3a3ae17

Please sign in to comment.