conv_bool.js 929 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function t1(c)
  6. {
  7. if ((c != -1) != 1)
  8. {
  9. return true;
  10. }
  11. else
  12. {
  13. return false;
  14. }
  15. }
  16. function t2(c)
  17. {
  18. if ((c <= -1) != 1)
  19. {
  20. return true;
  21. }
  22. else
  23. {
  24. return false;
  25. }
  26. }
  27. function t3(c)
  28. {
  29. if ((c >= -1) != 1)
  30. {
  31. return true;
  32. }
  33. else
  34. {
  35. return false;
  36. }
  37. }
  38. if (!t1(1) && !t1(1) && t1(-1) &&
  39. t2(1) && t2(1) && !t2(-1) &&
  40. !t3(1) && !t3(1) && !t3(-1)
  41. )
  42. {
  43. WScript.Echo("Passed");
  44. }
  45. else
  46. {
  47. WScript.Echo("FAILED");
  48. }