Fossil

Check-in [46e92c25]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Some coding style corrections in the TH1 tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:46e92c25e09d198131175b32d3bf3ed02bed322f
User & Date: mistachkin 2016-08-18 01:50:58
Context
2016-08-18
01:52
Add more environment variables to the 'test_env' page. check-in: 33561a22 user: mistachkin tags: trunk
01:50
Some coding style corrections in the TH1 tests. check-in: 46e92c25 user: mistachkin tags: trunk
01:47
Add tests for the 'anycap', 'anoncap', and 'hascap' TH1 commands. Also, add the --set-user-caps and --set-anon-caps options to the 'test-th-eval', 'test-th-render', and 'test-th-source' test commands. check-in: 5ea2a4fb user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/th1.test.

557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583


584
585
586


587
588
589


590
591
592


593
594
595


596
597


598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
###############################################################################

foreach perm [list a b c d e f g h i j k l m n o p q r s t u v w x y z] {
  if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission.
  if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission.

  fossil test-th-eval "anycap $perm"
  test th1-anycap-no-$perm {$RESULT eq {0}}

  fossil test-th-eval "hascap $perm"
  test th1-hascap-no-$perm {$RESULT eq {0}}

  fossil test-th-eval "anoncap $perm"
  test th1-anoncap-no-$perm {$RESULT eq {0}}

  run_in_checkout {
    fossil test-th-eval --set-user-caps "anycap $perm"
    test th1-anycap-yes-$perm {$RESULT eq {1}}

    fossil test-th-eval --set-user-caps "hascap $perm"
    test th1-hascap-yes-$perm {$RESULT eq {1}}

    fossil test-th-eval --set-anon-caps "anoncap $perm"
    test th1-anoncap-yes-$perm {$RESULT eq {1}}
  }
}



fossil test-th-eval "anycap oh"
test th1-anycap-no-multiple {$RESULT eq {0}}



fossil test-th-eval "hascap oh"
test th1-hascap-no-multiple1 {$RESULT eq {0}}



fossil test-th-eval "hascap o h"
test th1-hascap-no-multiple2 {$RESULT eq {0}}



fossil test-th-eval "anoncap oh"
test th1-anoncap-no-multiple1 {$RESULT eq {0}}



fossil test-th-eval "anoncap o h"
test th1-anoncap-no-multiple2 {$RESULT eq {0}}



run_in_checkout {
  fossil test-th-eval --set-user-caps "anycap oh"
  test th1-anycap-yes-multiple1 {$RESULT eq {1}}

  fossil test-th-eval --set-user-caps "hascap oh"
  test th1-hascap-yes-multiple1 {$RESULT eq {1}}

  fossil test-th-eval --set-user-caps "hascap o h"
  test th1-hascap-yes-multiple2 {$RESULT eq {1}}

  fossil test-th-eval --set-anon-caps "anoncap oh"
  test th1-anoncap-yes-multiple1 {$RESULT eq {1}}

  fossil test-th-eval --set-anon-caps "anoncap o h"
  test th1-anoncap-yes-multiple2 {$RESULT eq {1}}
}

###############################################################################

run_in_checkout {
  # NOTE: The "1" here forces the checkout to be opened.
  fossil test-th-eval "checkout 1"







|


|


|



|


|


|



>
>

|

>
>

|

>
>

|

>
>

|

>
>

|
>
>



|


|


|


|


|







557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
###############################################################################

foreach perm [list a b c d e f g h i j k l m n o p q r s t u v w x y z] {
  if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission.
  if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission.

  fossil test-th-eval "anycap $perm"
  test th1-anycap-no-$perm-1 {$RESULT eq {0}}

  fossil test-th-eval "hascap $perm"
  test th1-hascap-no-$perm-1 {$RESULT eq {0}}

  fossil test-th-eval "anoncap $perm"
  test th1-anoncap-no-$perm-1 {$RESULT eq {0}}

  run_in_checkout {
    fossil test-th-eval --set-user-caps "anycap $perm"
    test th1-anycap-yes-$perm-1 {$RESULT eq {1}}

    fossil test-th-eval --set-user-caps "hascap $perm"
    test th1-hascap-yes-$perm-1 {$RESULT eq {1}}

    fossil test-th-eval --set-anon-caps "anoncap $perm"
    test th1-anoncap-yes-$perm-1 {$RESULT eq {1}}
  }
}

###############################################################################

fossil test-th-eval "anycap oh"
test th1-anycap-no-multiple-1 {$RESULT eq {0}}

###############################################################################

fossil test-th-eval "hascap oh"
test th1-hascap-no-multiple-1 {$RESULT eq {0}}

###############################################################################

fossil test-th-eval "hascap o h"
test th1-hascap-no-multiple-2 {$RESULT eq {0}}

###############################################################################

fossil test-th-eval "anoncap oh"
test th1-anoncap-no-multiple-1 {$RESULT eq {0}}

###############################################################################

fossil test-th-eval "anoncap o h"
test th1-anoncap-no-multiple-2 {$RESULT eq {0}}

###############################################################################

run_in_checkout {
  fossil test-th-eval --set-user-caps "anycap oh"
  test th1-anycap-yes-multiple-1 {$RESULT eq {1}}

  fossil test-th-eval --set-user-caps "hascap oh"
  test th1-hascap-yes-multiple-1 {$RESULT eq {1}}

  fossil test-th-eval --set-user-caps "hascap o h"
  test th1-hascap-yes-multiple-2 {$RESULT eq {1}}

  fossil test-th-eval --set-anon-caps "anoncap oh"
  test th1-anoncap-yes-multiple-1 {$RESULT eq {1}}

  fossil test-th-eval --set-anon-caps "anoncap o h"
  test th1-anoncap-yes-multiple-2 {$RESULT eq {1}}
}

###############################################################################

run_in_checkout {
  # NOTE: The "1" here forces the checkout to be opened.
  fossil test-th-eval "checkout 1"