~ubuntu-branches/debian/sid/neovim/sid

« back to all changes in this revision

Viewing changes to test/functional/eval/operators_spec.lua

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2016-04-18 21:42:19 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20160418214219-1e6d4o1fwqarzk46
Tags: 0.1.3-1
* New upstream release.  (Closes: #820562)
* debian/control:
  + Remove unnecessary luarocks Build-Depends
  + Add libkvm-dev Build-Depends for kfreebsd-*
  + Add python(3)-neovim to Recommends.  (Closes: #812737)
  + Declare compiance with policy 3.9.8, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
local helpers = require('test.functional.helpers')
 
2
local eq = helpers.eq
 
3
local eval = helpers.eval
 
4
local clear = helpers.clear
 
5
 
 
6
describe('Division operator', function()
 
7
  before_each(clear)
 
8
 
 
9
  it('returns infinity on {positive}/0.0', function()
 
10
    eq('str2float(\'inf\')', eval('string(1.0/0.0)'))
 
11
    eq('str2float(\'inf\')', eval('string(1.0e-100/0.0)'))
 
12
    eq('str2float(\'inf\')', eval('string(1.0e+100/0.0)'))
 
13
    eq('str2float(\'inf\')', eval('string((1.0/0.0)/0.0)'))
 
14
  end)
 
15
 
 
16
  it('returns -infinity on {negative}/0.0', function()
 
17
    eq('-str2float(\'inf\')', eval('string((-1.0)/0.0)'))
 
18
    eq('-str2float(\'inf\')', eval('string((-1.0e-100)/0.0)'))
 
19
    eq('-str2float(\'inf\')', eval('string((-1.0e+100)/0.0)'))
 
20
    eq('-str2float(\'inf\')', eval('string((-1.0/0.0)/0.0)'))
 
21
  end)
 
22
 
 
23
  it('returns NaN on 0.0/0.0', function()
 
24
    eq('str2float(\'nan\')', eval('string(0.0/0.0)'))
 
25
    eq('str2float(\'nan\')', eval('string(-(0.0/0.0))'))
 
26
    eq('str2float(\'nan\')', eval('string((-0.0)/0.0)'))
 
27
  end)
 
28
end)