um 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/sh
  2. . ./Common
  3. ###############################################################################
  4. fped "um: iprint micrometers" <<EOF
  5. %iprint 100um
  6. EOF
  7. expect <<EOF
  8. 100um
  9. EOF
  10. #------------------------------------------------------------------------------
  11. fped "um: add mm + um" <<EOF
  12. %iprint 1mm + 100 um
  13. EOF
  14. expect <<EOF
  15. 1.1mm
  16. EOF
  17. #------------------------------------------------------------------------------
  18. fped "um: subtract mil - um" <<EOF
  19. %iprint 100mil - 100 um
  20. EOF
  21. expect <<EOF
  22. 2.44mm
  23. EOF
  24. #------------------------------------------------------------------------------
  25. fped "um: multiply um with um" <<EOF
  26. %iprint 100um * 50um
  27. EOF
  28. expect <<EOF
  29. 5000um^2
  30. EOF
  31. #------------------------------------------------------------------------------
  32. fped "um: multiply um with mm" <<EOF
  33. %iprint 100um * 2mm
  34. EOF
  35. expect <<EOF
  36. 0.2mm^2
  37. EOF
  38. #------------------------------------------------------------------------------
  39. fped "um: divide mil by um" <<EOF
  40. %iprint 20mil / 10um
  41. EOF
  42. expect <<EOF
  43. 50.8
  44. EOF
  45. #------------------------------------------------------------------------------
  46. fped_dump "um: use um in vector" <<EOF
  47. vec @(100um, 50um)
  48. EOF
  49. expect <<EOF
  50. /* MACHINE-GENERATED ! */
  51. package "_"
  52. unit mm
  53. __0: vec @(100um, 50um)
  54. EOF
  55. #------------------------------------------------------------------------------
  56. fped "um: measure distance in um" <<EOF
  57. a: vec @(0mm, 0mm)
  58. b: vec .(300um, 0mm)
  59. c: vec .(0mm, 400um)
  60. meas a >> c /* dummy */
  61. m: meas a >> c
  62. %meas m
  63. EOF
  64. expect <<EOF
  65. 0.5
  66. EOF