testDictionary.vbs 562 B

1234567891011121314151617181920212223242526
  1. ' Test Pyhon.Dictionary using VBScript - this uses
  2. ' IDispatchEx, so is an interesting test.
  3. set ob = CreateObject("Python.Dictionary")
  4. ob("hello") = "there"
  5. ' Our keys are case insensitive.
  6. ob.Item("hi") = ob("HELLO")
  7. dim ok
  8. ok = true
  9. if ob("hello") <> "there" then
  10. WScript.Echo "**** The dictionary value was wrong!!"
  11. ok = false
  12. end if
  13. if ob("hi") <> "there" then
  14. WScript.Echo "**** The other dictionary value was wrong!!"
  15. ok = false
  16. end if
  17. if ok then
  18. WScript.Echo "VBScript has successfully tested Python.Dictionary"
  19. end if