~zorba-coders/zorba/data-cleaning-missing-functions

« back to all changes in this revision

Viewing changes to test/Queries/data-cleaning/conversion/phone-from-user.xq

  • Committer: Tarmac
  • Author(s): Diogo Simões
  • Date: 2012-02-22 17:04:11 UTC
  • mfrom: (35.1.2 data-cleaning-module)
  • Revision ID: tarmac-20120222170411-7krik6tzd6asdtg4
Tags: 1.0, zorba-2.2
New changes in the tests of conversion module. These changes support variations of the webservices results. Approved: Bruno Martins, Chris Hillery

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import module namespace conversion = "http://www.zorba-xquery.com/modules/data-cleaning/conversion";
2
2
 
3
 
let $arg := conversion:phone-from-user ('Maria Lurdes')
 
3
let $arg := conversion:phone-from-user ('Maria Lurdes')[1]
4
4
let $result :=
5
 
  if(exists($arg) or empty($arg))
 
5
  if(matches($arg, "(\([0-9]{3}\) [0-9]{3}\-[0-9]{4})*") and not(matches($arg, "invalid")))
6
6
  then 'OK'
7
7
  else 'NOT OK'
8
8
return $result